summaryrefslogtreecommitdiffstats
path: root/gcc/cpplib.h
diff options
context:
space:
mode:
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2000-03-04 01:42:56 +0000
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2000-03-04 01:42:56 +0000
commit4f98874d1f473f1b257057e0f666c7361b266735 (patch)
treea52521153bf75ca10099523abb8586d4cb5851a7 /gcc/cpplib.h
parentad2fe2cdc0ca3b25f67354611b411599e9e97b6c (diff)
downloadppe42-gcc-4f98874d1f473f1b257057e0f666c7361b266735.tar.gz
ppe42-gcc-4f98874d1f473f1b257057e0f666c7361b266735.zip
* cpplib.h (_dollar_ok): New macro.
(is_idchar, is_idstart): Use it. (IStable): Rename to _cpp_IStable. Declare it const if gcc >=2.7 or C99. Delete all references to FAKE_CONST. (is_idchar, is_idstart, is_numchar, is_numstart, is_hspace, is_space): Update for renamed IStable. * cppinit.c: Delete all references to FAKE_CONST and CAT macros. Define init_IStable as empty macro if gcc >=2.7 or C99. Change TABLE() to ISTABLE and hardcode name of table. (cpp_start_read): Don't change the IStable based on dollars_in_ident. * cpphash.c (unsafe_chars): Add pfile argument. All callers changed. Handle '$' for char1 correctly. * cpplib.c (cpp_get_token): Use is_numchar when parsing numbers. * cppexp.c (tokentab2): Make const. (cpp_lex): Make toktab const. * cppinit.c (include_defaults_array): Make const. (initialize_standard_includes): Make default_include const. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@32321 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cpplib.h')
-rw-r--r--gcc/cpplib.h31
1 files changed, 16 insertions, 15 deletions
diff --git a/gcc/cpplib.h b/gcc/cpplib.h
index 85d07442b8c..a9e8f15204d 100644
--- a/gcc/cpplib.h
+++ b/gcc/cpplib.h
@@ -612,22 +612,23 @@ enum node_type {
#define IShspace 0x08 /* ' ' \t \f \v */
#define ISspace 0x10 /* ' ' \t \f \v \n */
-#define is_idchar(x) (IStable[x] & ISidnum)
-#define is_numchar(x) (IStable[x] & ISidnum)
-#define is_idstart(x) (IStable[x] & ISidstart)
-#define is_numstart(x) (IStable[x] & ISnumstart)
-#define is_hspace(x) (IStable[x] & IShspace)
-#define is_space(x) (IStable[x] & ISspace)
-
-/* This table is not really `const', but it is only modified at
- initialization time, in a separate translation unit from the rest
- of the library. We let the rest of the library think it is `const'
- to get better code and some additional compile-time checks. */
-#ifndef FAKE_CONST
-#define FAKE_CONST const
+#define _dollar_ok(x) ((x) == '$' && CPP_OPTIONS (pfile)->dollars_in_ident)
+
+#define is_idchar(x) ((_cpp_IStable[x] & ISidnum) || _dollar_ok(x))
+#define is_idstart(x) ((_cpp_IStable[x] & ISidstart) || _dollar_ok(x))
+#define is_numchar(x) (_cpp_IStable[x] & ISidnum)
+#define is_numstart(x) (_cpp_IStable[x] & ISnumstart)
+#define is_hspace(x) (_cpp_IStable[x] & IShspace)
+#define is_space(x) (_cpp_IStable[x] & ISspace)
+
+/* This table is constant if it can be initialized at compile time,
+ which is the case if cpp was compiled with GCC >=2.7, or another
+ compiler that supports C99. */
+#if (GCC_VERSION >= 2007) || (__STDC_VERSION__ >= 199901L)
+extern const unsigned char _cpp_IStable[256];
+#else
+extern unsigned char _cpp_IStable[256];
#endif
-extern FAKE_CONST unsigned char IStable[256];
-#undef FAKE_CONST
/* Stack of conditionals currently in progress
(including both successful and failing conditionals). */
OpenPOWER on IntegriCloud