Some old glibcs <wctype.h> require <stddef.h> to provide wint_t, accomodate them.
Showing the changes to include (1 of 2 files). Show all
Unified · Split
| @@ -26,3 +26,18 @@ typedef unsigned long long int uint64_t; · 25 unmodified lines | ||
| 26 | 26 | void *alloca(size_t size); |
| 27 | 27 | |
| 28 | 28 | #endif |
| 29 | + | |
| 30 | +/* Older glibc require a wint_t from <stddef.h> (when requested | |
| 31 | + by __need_wint_t, as otherwise stddef.h isn't allowed to | |
| 32 | + define this type). Note that this must be outside the normal | |
| 33 | + _STDDEF_H guard, so that it works even when we've included the file | |
| 34 | + already (without requring wint_t). Some other libs define _WINT_T | |
| 35 | + if they've already provided that type, so we can use that as guard. | |
| 36 | + TCC defines __WINT_TYPE__ for us. */ | |
| 37 | +#if defined (__need_wint_t) | |
| 38 | +#ifndef _WINT_T | |
| 39 | +#define _WINT_T | |
| 40 | +typedef __WINT_TYPE__ wint_t; | |
| 41 | +#endif | |
| 42 | +#undef __need_wint_t | |
| 43 | +#endif | |