[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
stdint C99 compat checks in m4/stdint.m4 break when wchar_t is unsigned
From: |
Riku Voipio |
Subject: |
stdint C99 compat checks in m4/stdint.m4 break when wchar_t is unsigned int |
Date: |
Thu, 27 Sep 2007 00:56:33 +0300 |
User-agent: |
Mutt/1.5.11+cvs20060126 |
After some intensive hair pulling on why libidn breaks arm eabi port,
turns out libidn did not like gnulib telling it that stdint.h is not
C99 compatible... Any why not?
int check_WCHAR:
WCHAR_MIN == TYPE_MINIMUM (wchar_t)
&& WCHAR_MAX == TYPE_MAXIMUM (wchar_t)
? 1 : -1;
/* Detect bug in mingw. */
Which makes sense, but turns out TYPE_MAXIMUM seem uncipherable:
#define TYPE_MINIMUM(t) \
((t) ((t) 0 < (t) -1 ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))
#define TYPE_MAXIMUM(t) \
((t) ((t) 0 < (t) -1 ? (t) -1 : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))))
Neither of these macros seem to work expected if (t) is wchar_t and wchar_t is
defined
as unsigned int. Which happens to be the case on arm-linux-gnueabi...
--
"rm -rf" only sounds scary if you don't have backups
- stdint C99 compat checks in m4/stdint.m4 break when wchar_t is unsigned int,
Riku Voipio <=