]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[libc] Define wchar_t in a gcc-compatible way
authorMichael Brown <mcb30@etherboot.org>
Tue, 7 Oct 2008 21:27:55 +0000 (22:27 +0100)
committerMichael Brown <mcb30@etherboot.org>
Tue, 7 Oct 2008 21:27:55 +0000 (22:27 +0100)
gcc defines the magic __WCHAR_TYPE__ macro, in order to convey
information about whether or not the user selected -fshort-wchar.

src/include/stddef.h

index 6f91d21915af8dbaf763b30f8aefa91f2c72ad1a..11ea93456f6a2d5351f71e7a0d5e94382aba02bc 100644 (file)
        const typeof( ((type *)0)->member ) *__mptr = (ptr);    \
        (type *)( (char *)__mptr - offsetof(type,member) );})
 
+/* __WCHAR_TYPE__ is defined by gcc and will change if -fshort-wchar is used */
+#ifndef __WCHAR_TYPE__
+#define __WCHAR_TYPE__ long int
+#endif
+typedef __WCHAR_TYPE__ wchar_t;
+
 #endif /* STDDEF_H */