Add our own trivial version of stdarg.h. This makes our build
authorMichael Brown <mcb30@etherboot.org>
Sat, 9 Jun 2007 17:11:07 +0000 (18:11 +0100)
committerMichael Brown <mcb30@etherboot.org>
Sat, 9 Jun 2007 23:29:53 +0000 (00:29 +0100)
entirely self-hosted (which avoids problems when building the same
tree on multiple systems - e.g. when you have /home NFS-mounted).

Also saves around 50 bytes in total - not sure why.

src/arch/i386/include/stdarg.h [new file with mode: 0644]

diff --git a/src/arch/i386/include/stdarg.h b/src/arch/i386/include/stdarg.h
new file mode 100644 (file)
index 0000000..1742cb3
--- /dev/null
@@ -0,0 +1,22 @@
+#ifndef _STDARG_H
+#define _STDARG_H
+
+typedef void * va_list;
+
+#define va_start( ap, last ) do {      \
+               ap = ( &last + 1 );     \
+       } while ( 0 )
+
+#define va_arg( ap, type ) ({          \
+               type *_this = ap;       \
+               ap = ( _this + 1 );     \
+               *(_this);               \
+       })
+
+#define va_end( ap ) do { } while ( 0 )
+
+#define va_copy( dest, src ) do {      \
+               dest = src;             \
+       } while ( 0 )
+
+#endif /* _STDARG_H */