History

Declare wint_t in <stddef.h> when needed

Some old glibcs <wctype.h> require <stddef.h> to provide wint_t, accomodate them.

Michael Matz committed 12 years ago

Commit 0961a381 parent 0e43f3a2 files · +24 −0Browse files

Showing the changes to include (1 of 2 files). Show all

Unified · Split

include/stddef.h+15−0
@@ -26,3 +26,18 @@ typedef unsigned long long int uint64_t; · 25 unmodified lines
2626 void *alloca(size_t size);
2727
2828 #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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t