commit 70753d6a82d531e7ed9a622e11d0b4c6f5669e44
parent e45976cd705d5ec847b7a7dd38dad11e6ad13f51
Author: vaplv <vaplv@free.fr>
Date: Tue, 28 Jul 2015 11:06:41 +0200
Add the VA_COPY macro
This macro calls the GCC built-in __va_copy macro or its C99
va_copy alternative whether GCC is used or not.
Diffstat:
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/src/rsys.h b/src/rsys.h
@@ -282,6 +282,14 @@ typedef int res_T;
/*******************************************************************************
* Miscellaneous
******************************************************************************/
+#ifdef COMPILER_GCC
+ /* On GCC compiler we follow the C-89 standard that does not support the
+ * va_copy macro. We thus use the built-in __va_copy GCC extension */
+ #define VA_COPY(VArgs, Args) __va_copy((VArgs), (Args))
+#else
+ #define VA_COPY(VArgs, Args) va_copy((VArgs), (Args))
+#endif
+
#define BIT(Num) (1 << (Num))
#define CONCAT__(A, B) A ## B
#define CONCAT(A, B) CONCAT__(A, B)