+#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 before version 3 has its own name */
-#if defined(__GNUC__) && (__GNUC__ == 2)
+/* 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