From 6ceed0929d1e11c9d8807427750bb6e4f14806fd Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Mon, 8 Apr 2013 16:55:47 -0700 Subject: libpayload: Don't sneak in compiler includes The way we got to include the compiler includes was kind of whacky. Instead of mixing in potentially problematic headers, make libpayload self-contained by adding some missing header files. Also clean up conflicting definitions of size_t throughout the tree. Signed-off-by: Stefan Reinauer Change-Id: I0ad1194de1a00b7133c5477c00eb167d63a2ee85 Reviewed-on: https://gerrit.chromium.org/gerrit/47608 Reviewed-by: Ronald G. Minnich Commit-Queue: Stefan Reinauer Tested-by: Stefan Reinauer Reviewed-on: http://review.coreboot.org/3058 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich --- payloads/libpayload/include/stdarg.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'payloads/libpayload/include/stdarg.h') diff --git a/payloads/libpayload/include/stdarg.h b/payloads/libpayload/include/stdarg.h index 077645f227..1d7ac051f4 100644 --- a/payloads/libpayload/include/stdarg.h +++ b/payloads/libpayload/include/stdarg.h @@ -31,7 +31,20 @@ #define _LIBPAYLOAD_STDARG_H #include + +/* With GCC we use -nostdinc -ffreestanding to keep out system includes. + * Unfortunately this also gets us rid of the _compiler_ includes, like + * stdarg.h. To work around the issue, we define varargs directly here. + * On LLVM we can still just include stdarg.h. + */ +#ifdef __GNUC__ +#define va_start(v,l) __builtin_va_start(v,l) +#define va_end(v) __builtin_va_end(v) +#define va_arg(v,l) __builtin_va_arg(v,l) +typedef __builtin_va_list va_list; +#else #include_next +#endif /** * @defgroup vprintf Varargs print functions -- cgit v1.2.3