Explorar el Código

[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 hace 16 años
padre
commit
160b950af8
Se han modificado 1 ficheros con 6 adiciones y 0 borrados
  1. 6
    0
      src/include/stddef.h

+ 6
- 0
src/include/stddef.h Ver fichero

@@ -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…
Cancelar
Guardar