From 160b950af816d193509d5ce704a8d9e709aab912 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 7 Oct 2008 22:27:55 +0100 Subject: [PATCH] [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. --- src/include/stddef.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/include/stddef.h b/src/include/stddef.h index 6f91d219..11ea9345 100644 --- a/src/include/stddef.h +++ b/src/include/stddef.h @@ -15,4 +15,10 @@ 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 */