Pārlūkot izejas kodu

[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 gadus atpakaļ
vecāks
revīzija
160b950af8
1 mainītis faili ar 6 papildinājumiem un 0 dzēšanām
  1. 6
    0
      src/include/stddef.h

+ 6
- 0
src/include/stddef.h Parādīt failu

@@ -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 */

Notiek ielāde…
Atcelt
Saglabāt