[PATCH] Fix for inttypes.h
Jakub Jelinek
jakub@redhat.com
Sat Sep 1 12:12:00 GMT 2001
Hi!
Looks like my last change to inttypes.h was not sufficient:
echo > test.C <<EOF
#include <wchar.h>
#include <inttypes.h>
EOF
g++ -c -O2 test.C
In file included from test.C:2:
/usr/include/inttypes.h: In function `intmax_t wcstoimax (const __gwchar_t *, __gwchar_t **, int)':
/usr/include/inttypes.h:432: cannot convert `const __gwchar_t *__restrict' to `const __wchar_t *' for argument to `__wcstoll_internal (const __wchar_t *, __wchar_t **, int, int)'
/usr/include/inttypes.h: In function `uintmax_t wcstoumax (const __gwchar_t *, __gwchar_t **, int)':
/usr/include/inttypes.h:451: cannot convert `const __gwchar_t *__restrict' to `const __wchar_t *' for argument to `__wcstoull_internal (const __wchar_t *, __wchar_t **, int, int)'
(with g++ 3.0.1, the error messages print wchar_t instead of __wchar_t).
Fixed thusly:
2001-09-01 Jakub Jelinek <jakub@redhat.com>
* sysdeps/generic/inttypes.h (__gwchar_t): Define to wchar_t for C++.
--- libc/sysdeps/generic/inttypes.h.jj Fri Aug 24 11:09:51 2001
+++ libc/sysdeps/generic/inttypes.h Sat Sep 1 21:01:20 2001
@@ -29,7 +29,9 @@
/* Get a definition for wchar_t. But we must not define wchar_t itself. */
#ifndef ____gwchar_t_defined
-# ifdef __WCHAR_TYPE__
+# ifdef __cplusplus
+# define __gwchar_t wchar_t
+# elif defined __WCHAR_TYPE__
typedef __WCHAR_TYPE__ __gwchar_t;
# else
# defined __need_wchar_t
Jakub
More information about the Libc-hacker
mailing list