aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpplib.h
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.demon.co.uk>2002-05-04 19:42:01 +0000
committerNeil Booth <neil@gcc.gnu.org>2002-05-04 19:42:01 +0000
commit625458d0b97e2665f53f56832778214e7e7ae6b6 (patch)
tree93fad2ddad4007e009671f2fd3bcb16a3937b345 /gcc/cpplib.h
parent916b60b71e4ac6ef8184427616df27b843de4271 (diff)
downloadgcc-625458d0b97e2665f53f56832778214e7e7ae6b6.zip
gcc-625458d0b97e2665f53f56832778214e7e7ae6b6.tar.gz
gcc-625458d0b97e2665f53f56832778214e7e7ae6b6.tar.bz2
cppinit.c (MAX_WCHAR_TYPE_SIZE): Move to cpplib.h
* cppinit.c (MAX_WCHAR_TYPE_SIZE): Move to cpplib.h (cpp_post_options): Move sanity checks to... (sanity_checks): New. * cpplex.c (maybe_read_ucs): Fix prototype. (parse_string, cpp_parse_escape): Cast for %c format specifier. * cpplib.h (cppchar_t): Use unsigned long or unsigned long long if necessary. From-SVN: r53163
Diffstat (limited to 'gcc/cpplib.h')
-rw-r--r--gcc/cpplib.h21
1 files changed, 16 insertions, 5 deletions
diff --git a/gcc/cpplib.h b/gcc/cpplib.h
index 520f2a2..9063647 100644
--- a/gcc/cpplib.h
+++ b/gcc/cpplib.h
@@ -191,11 +191,22 @@ struct cpp_token
};
/* A type wide enough to hold any multibyte source character.
- cpplib's character constant interpreter uses shifts, and so
- requires an unsigned type. */
-typedef unsigned int cppchar_t;
-/* Its signed equivalent. */
-typedef int cppchar_signed_t;
+ cpplib's character constant interpreter requires an unsigned type.
+ Also, a typedef for the signed equivalent. */
+#ifndef MAX_WCHAR_TYPE_SIZE
+# define MAX_WCHAR_TYPE_SIZE WCHAR_TYPE_SIZE
+#endif
+#if SIZEOF_INT >= MAX_WCHAR_TYPE_SIZE
+# define CPPCHAR_SIGNED_T int
+#else
+# if SIZEOF_LONG >= MAX_WCHAR_TYPE_SIZE || !HAVE_LONG_LONG
+# define CPPCHAR_SIGNED_T long
+# else
+# define CPPCHAR_SIGNED_T long long
+# endif
+#endif
+typedef unsigned CPPCHAR_SIGNED_T cppchar_t;
+typedef CPPCHAR_SIGNED_T cppchar_signed_t;
/* Values for opts.dump_macros.
dump_only means inhibit output of the preprocessed text