]> git.sur5r.net Git - cc65/blobdiff - src/common/va_copy.h
Merge remote-tracking branch 'upstream/master' into a5200
[cc65] / src / common / va_copy.h
index 7354d62074b65597a0e618358c1c120793faaaaf..2f56efa1a6e4cb28b939c374843d51fd2ee52210 100644 (file)
 
 
 
+#include <stdarg.h>
+
+
+                   
+/* No action if we have a working va_copy */
+#if !defined(va_copy)
+
+
+
 /* The watcom compiler doesn't have va_copy and a problematic va_list definition */
 #if defined(__WATCOMC__)
-
 #define va_copy(dest,src)       memcpy((dest), (src), sizeof (va_list))
+#endif
 
+/* GNU C has a builtin function */
+#if defined(__GNUC__)
+#define va_copy(dest,src)       __va_copy(dest, src)
+#endif
+
+/* MS VC allows for assignment */
+#if defined(_MSC_VER)
+#define va_copy(dest,src)       ((dest) = (src))
+#endif
+
+/* If va_copy is not defined now, we have a problem */
+#if !defined(va_copy)
+#error "Need a working va_copy!"
 #endif
 
 
 
-/* End of va_copy.h */
 #endif
 
 
 
+/* End of va_copy.h */
+
+#endif