--- lib.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib.c b/lib.c index d765d75..d80bc28 100644 --- a/lib.c +++ b/lib.c @@ -479,10 +479,13 @@ void create_builtin_stream(void) // gcc defines __SIZE_TYPE__ to be size_t. For linux/i86 and // solaris/sparc that is really "unsigned int" and for linux/x86_64 - // it is "long unsigned int". In either case we can probably - // get away with this. We need the #ifndef as cgcc will define + // it is "long unsigned int". We need the #ifndef as cgcc will define // the right __SIZE_TYPE__. - add_pre_buffer("#weak_define __SIZE_TYPE__ long unsigned int\n"); + if (sizeof(size_t) == sizeof(unsigned int)) + add_pre_buffer("#weak_define __SIZE_TYPE__ unsigned int\n"); + else + add_pre_buffer("#weak_define __SIZE_TYPE__ long unsigned int\n"); + add_pre_buffer("#weak_define __STDC__ 1\n"); add_pre_buffer("#define __builtin_stdarg_start(a,b) ((a) = (__builtin_va_list)(&(b)))\n");