summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include/stdarg.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/amd64/include/stdarg.h')
-rw-r--r--sys/amd64/include/stdarg.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/sys/amd64/include/stdarg.h b/sys/amd64/include/stdarg.h
index 53985af..c13137d 100644
--- a/sys/amd64/include/stdarg.h
+++ b/sys/amd64/include/stdarg.h
@@ -39,6 +39,7 @@
typedef __va_list va_list;
#endif
+#if defined(__GNUC__)
#define va_start(ap, last) \
__builtin_stdarg_start((ap), (last))
@@ -53,4 +54,16 @@ typedef __va_list va_list;
#define va_end(ap) \
__builtin_va_end(ap)
+#elif defined(lint)
+/* Provide a fake implementation for lint's benefit */
+#define __va_size(type) \
+ (((sizeof(type) + sizeof(long) - 1) / sizeof(long)) * sizeof(long))
+#define va_start(ap, last) \
+ ((ap) = (va_list)&(last) + __va_size(last))
+#define va_arg(ap, type) \
+ (*(type *)((ap) += __va_size(type), (ap) - __va_size(type)))
+#define va_end(ap)
+
+#endif
+
#endif /* !_MACHINE_STDARG_H_ */
OpenPOWER on IntegriCloud