Declare wint_t in <stddef.h> when needed
Some old glibcs <wctype.h> require <stddef.h> to provide wint_t, accomodate them.
This commit is contained in:
9
libtcc.c
9
libtcc.c
@ -988,8 +988,17 @@ LIBTCCAPI TCCState *tcc_new(void)
|
||||
|
||||
#ifdef TCC_TARGET_PE
|
||||
tcc_define_symbol(s, "__WCHAR_TYPE__", "unsigned short");
|
||||
tcc_define_symbol(s, "__WINT_TYPE__", "unsigned short");
|
||||
#else
|
||||
tcc_define_symbol(s, "__WCHAR_TYPE__", "int");
|
||||
/* wint_t is unsigned int by default, but (signed) int on BSDs
|
||||
and unsigned short on windows. Other OSes might have still
|
||||
other conventions, sigh. */
|
||||
#if defined(__FreeBSD__) || defined (__FreeBSD_kernel__)
|
||||
tcc_define_symbol(s, "__WINT_TYPE__", "int");
|
||||
#else
|
||||
tcc_define_symbol(s, "__WINT_TYPE__", "unsigned int");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef TCC_TARGET_PE
|
||||
|
||||
Reference in New Issue
Block a user