[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT PATCH 1/5] lib/nolibc: don't include stdarg.h from stdio.h



Signed-off-by: Florian Schmidt <florian.schmidt@xxxxxxxxx>
---
 lib/nolibc/include/stdio.h | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/lib/nolibc/include/stdio.h b/lib/nolibc/include/stdio.h
index 073b132..539aecf 100644
--- a/lib/nolibc/include/stdio.h
+++ b/lib/nolibc/include/stdio.h
@@ -37,7 +37,6 @@
 #define __STDIO_H__
 
 #include <stddef.h>
-#include <stdarg.h>
 #include <uk/essentials.h>
 
 #ifdef __cplusplus
@@ -51,6 +50,14 @@ extern FILE *stdin;
 extern FILE *stdout;
 extern FILE *stderr;
 
+/* stdio.h shall not define va_list if it is included, but it shall
+ * declare functions that use va_list.
+ */
+#ifndef va_list
+#define __STDIO_H_DEFINED_va_list
+#define va_list __builtin_va_list
+#endif
+
 int vsnprintf(char *str, size_t size, const char *fmt, va_list ap);
 int  snprintf(char *str, size_t size, const char *fmt, ...) __printf(3, 4);
 
@@ -64,6 +71,10 @@ int   fflush(FILE *fp);
 int vprintf(const char *fmt, va_list ap);
 int  printf(const char *fmt, ...)                           __printf(1, 2);
 
+#ifdef __STDIO_H_DEFINED_va_list
+#undef va_list
+#endif
+
 #ifdef __cplusplus
 }
 #endif
-- 
2.18.0


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.