[cfe-commits] [PATCH] 7571: stddef.h and wint_t

Jay Foad jay.foad at gmail.com
Fri Jul 9 01:10:12 PDT 2010


http://llvm.org/bugs/show_bug.cgi?id=7571

On Ubuntu I get:

$ cat c.c
#include <stddef.h>
#include <wctype.h>
$ clang -c c.c
In file included from c.c:2:
/usr/include/wctype.h:112:22: error: unknown type name 'wint_t'
extern int iswalnum (wint_t __wc) __THROW;
                     ^
...

The problem is that Clang's stddef.h only defines win_t if
__need_wint_t is defined the *first* time stddef.h is included.
Glibc's wctype.h does this:

/* Get wint_t from <stddef.h>.  */
# define __need_wint_t
# include <stddef.h>

but that doesn't work if stddef.h has been included previously.

I've attached a suggested fix.

Thanks,
Jay.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 7571.diff
Type: text/x-patch
Size: 648 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20100709/86cc48fd/attachment.bin>


More information about the cfe-commits mailing list