We can use the ISO C headers from gcc (float.h, limits.h, stdarg.h, ... ) with this small source code change
Index: include/stdlib.h
===================================================================
--- include/stdlib.h (revision 268)
+++ include/stdlib.h (working copy)
@@ -1,7 +1,7 @@
#ifndef STDLIB_H
#define STDLIB_H
-#define NULL ((void*)0)
+#include <stddef.h>
#define SEEK_SET 0
#define SEEK_CUR 1
Index: platform/generic/wrappers.c
===================================================================
--- platform/generic/wrappers.c (revision 268)
+++ platform/generic/wrappers.c (working copy)
@@ -1,3 +1,4 @@
+#include <stdarg.h>
#include "lolevel.h"
#include "platform.h"
@@ -275,10 +276,10 @@
long sprintf(char *s, const char *st, ...)
{
long res;
- __builtin_va_list va;
- __builtin_va_start(va, st);
+ va_list va;
+ va_start(va, st);
res = _vsprintf(s, st, va);
- __builtin_va_end(va);
+ va_end(va);
return res;
}
Index: makefile.inc
===================================================================
--- makefile.inc (revision 268)
+++ makefile.inc (working copy)
@@ -126,10 +126,10 @@
%.o: %.c
@echo $< \-\> $@
- $(CC) $(CFLAGS) -nostdinc -c -o $@ $<
+ $(CC) $(CFLAGS) -c -o $@ $<
%.o: %.S
@echo $< \-\> $@
- $(CC) $(CFLAGS) -nostdinc -c -o $@ $<
+ $(CC) $(CFLAGS) -c -o $@ $<
%.a:
@echo $^ \-\> $@
$(AR) rcs $@ $^