[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gcc 2.8.1 va_arg problem
Theo solved the problem within half an hour with the included
patch. Bravo/thanks.
------------------------------------------------------------
Martin Portmann Phone +41-41-7832720
infinitum AG, Switzerland Fax +41-41-7832721
Software Solutions www.infinitum.ch
Index: stdarg.h
===================================================================
RCS file: /cvs/src/sys/arch/i386/include/stdarg.h,v
retrieving revision 1.2
diff -u -r1.2 stdarg.h
--- stdarg.h 1995/12/30 08:48:11 1.2
+++ stdarg.h 1999/06/03 21:01:19
@@ -45,8 +45,13 @@
#define __va_size(type) \
(((sizeof(type) + sizeof(long) - 1) / sizeof(long)) * sizeof(long))
+#ifdef __GNUC__
+#define va_start(ap, last) \
+ ((ap) = (va_list)__builtin_next_arg(last))
+#else
#define va_start(ap, last) \
((ap) = (va_list)&(last) + __va_size(last))
+#endif
#define va_arg(ap, type) \
(*(type *)((ap) += __va_size(type), (ap) - __va_size(type)))