Browse Source

[libc] Define wchar_t in a gcc-compatible way

gcc defines the magic __WCHAR_TYPE__ macro, in order to convey
information about whether or not the user selected -fshort-wchar.
tags/v0.9.6
Michael Brown 16 years ago
parent
commit
160b950af8
1 changed files with 6 additions and 0 deletions
  1. 6
    0
      src/include/stddef.h

+ 6
- 0
src/include/stddef.h View File

@@ -15,4 +15,10 @@
15 15
 	const typeof( ((type *)0)->member ) *__mptr = (ptr);    \
16 16
 	(type *)( (char *)__mptr - offsetof(type,member) );})
17 17
 
18
+/* __WCHAR_TYPE__ is defined by gcc and will change if -fshort-wchar is used */
19
+#ifndef __WCHAR_TYPE__
20
+#define __WCHAR_TYPE__ long int
21
+#endif
22
+typedef __WCHAR_TYPE__ wchar_t;
23
+
18 24
 #endif /* STDDEF_H */

Loading…
Cancel
Save