diff options
author | Andreas Baumann <abaumann@yahoo.com> | 2009-03-10 19:33:15 +0100 |
---|---|---|
committer | Andreas Baumann <abaumann@yahoo.com> | 2009-03-10 19:33:15 +0100 |
commit | 4d32ec5ab668d02c5b3dee83f0d8275b70e9014d (patch) | |
tree | a11253f14cdfaa024d9079fa3908d0995d121874 /include | |
parent | ec73c109debbca1d24c40126e20bc4347b3b6db0 (diff) | |
download | wolfbones-4d32ec5ab668d02c5b3dee83f0d8275b70e9014d.tar.gz wolfbones-4d32ec5ab668d02c5b3dee83f0d8275b70e9014d.tar.bz2 |
fixed snprintf/stdio changes on Cygwin
Diffstat (limited to 'include')
-rw-r--r-- | include/wolf/port/stdio.h | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/include/wolf/port/stdio.h b/include/wolf/port/stdio.h index bcf8d29..03e4d77 100644 --- a/include/wolf/port/stdio.h +++ b/include/wolf/port/stdio.h @@ -33,34 +33,32 @@ #include <stdio.h> -#if defined HAVE_STDARG_H -#include <stdarg.h> /* for va_list */ -#endif - -#if defined HAVE_SYS_TYPES_H -#include <sys/types.h> /* for size_t */ -#endif - /* TODO: check which features we need in snprintf, make sure the platform one supports it, * otherwise we take the stub */ /* TODO: also clean up mess here with autoconf relicts! */ #if defined _WIN32 /* secure snprintf on Wndows is called differently */ #define snprintf sprintf_s + #else +#include <stdarg.h> /* for va_list */ + +#include <sys/types.h> /* for size_t */ + #if !defined HAVE_SNPRINTF || defined WOLF_TEST_SNPRINTF extern int rpl_snprintf( char *str, size_t size, const char *format, ... ); #endif /* !defined HAVE_SNPRINTF || defined TEST_SNPRINTF */ #if !defined HAVE_SNPRINTF -#define snprintf( s1, s2, n ) rpl_snprintf( s1, s2, n ) +/* TODO: with variadic macros, we can define a much better macro here! */ +#define snprintf rpl_snprintf #endif /* !defined HAVE_SNPRINTF */ #if !defined HAVE_VSNPRINTF || defined WOLF_TEST_VSNPRINTF extern int rpl_vsnprintf( char *str, size_t size, const char *format, va_list args ); #endif /* !defined HAVE_VSNPRINTF || defined TEST_VSNPRINTF */ #if !defined HAVE_VSNPRINTF -#define vsnprintf rpl_vsnprintf +#define vsnprintf( str, size, format, ap ) rpl_vsnprintf( str, size, format, ap ) #endif /* !defined HAVE_VSNPRINTF */ #endif /* defined _WIN32 */ |