浏览代码

[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 年前
父节点
当前提交
160b950af8
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6
    0
      src/include/stddef.h

+ 6
- 0
src/include/stddef.h 查看文件

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

正在加载...
取消
保存