瀏覽代碼

[build] Default to short wchar_t in stddef.h

sparse does not understand -fshort-wchar.  Default to using uint16_t
as a wchar_t if not explicitly specified by the compiler, to avoid
large numbers of spurious warnings from sparse.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 11 年之前
父節點
當前提交
1aca99f3cf
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2
    2
      src/include/stddef.h

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

@@ -23,10 +23,10 @@ FILE_LICENCE ( GPL2_ONLY );
23 23
 
24 24
 /* __WCHAR_TYPE__ is defined by gcc and will change if -fshort-wchar is used */
25 25
 #ifndef __WCHAR_TYPE__
26
-#define __WCHAR_TYPE__ long int
26
+#define __WCHAR_TYPE__ uint16_t
27 27
 #endif
28 28
 #ifndef __WINT_TYPE__
29
-#define __WINT_TYPE__ long int
29
+#define __WINT_TYPE__ int
30 30
 #endif
31 31
 typedef __WCHAR_TYPE__ wchar_t;
32 32
 typedef __WINT_TYPE__ wint_t;

Loading…
取消
儲存