summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include/stdarg.h
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2003-05-10 00:55:15 +0000
committerpeter <peter@FreeBSD.org>2003-05-10 00:55:15 +0000
commit952d1b68b26afda6ca7b160eef87ed27273ce576 (patch)
tree0142740c93b144e2abc9d61f922b647017d84074 /sys/amd64/include/stdarg.h
parent4d4f676db4e68edc299c0c003783b0661e530e96 (diff)
downloadFreeBSD-src-952d1b68b26afda6ca7b160eef87ed27273ce576.zip
FreeBSD-src-952d1b68b26afda6ca7b160eef87ed27273ce576.tar.gz
Provide a fake varargs implementation for lint's benefit. This way
it can see the intent of the va_* macros, even though it cannot work. Approved by: re (blanket amd64/*)
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