diff --git a/src/core/vsprintf.c b/src/core/vsprintf.c index b22ae310..414b4509 100644 --- a/src/core/vsprintf.c +++ b/src/core/vsprintf.c @@ -1,5 +1,8 @@ -#include "etherboot.h" #include +#include "if_ether.h" /* for ETH_ALEN */ +#include "limits.h" /* for CHAR_BIT */ +#include "console.h" +#include "vsprintf.h" #define LONG_SHIFT ((int)((sizeof(unsigned long)*CHAR_BIT) - 4)) #define INT_SHIFT ((int)((sizeof(unsigned int)*CHAR_BIT) - 4)) diff --git a/src/include/console.h b/src/include/console.h index ce2e5392..55ce7309 100644 --- a/src/include/console.h +++ b/src/include/console.h @@ -2,6 +2,7 @@ #define CONSOLE_H #include "stdint.h" +#include "vsprintf.h" /* * Consoles that cannot be used before their INIT_FN() has completed diff --git a/src/include/vsprintf.h b/src/include/vsprintf.h new file mode 100644 index 00000000..2bf20085 --- /dev/null +++ b/src/include/vsprintf.h @@ -0,0 +1,14 @@ +#ifndef VSPRINTF_H +#define VSPRINTF_H + +/* + * Note that we cannot use __attribute__ (( format ( printf, ... ) )) + * to get automatic type checking on arguments, because we use + * non-standard format characters such as "%!" and "%@". + * + */ + +extern int sprintf ( char *buf, const char *fmt, ... ); +extern void printf ( const char *fmt, ... ); + +#endif /* VSPRINTF_H */