macro.c (_cpp_builtin_macro_text): Handle BT_COUNTER.
* macro.c (_cpp_builtin_macro_text): Handle BT_COUNTER. * pch.c (cpp_write_pch_deps): Save __COUNTER__ state. (cpp_write_pch_state): Save __COUNTER__ state. (cpp_valid_state): Check valid __COUNTER__ state. (cpp_read_state): Read new __COUNTER__ state. * include/cpplib.h (enum builtin_type): Add BT_COUNTER enumerator. * init.c (builtin_array): Add __COUNTER__/BT_COUNTER. * internal.h (struct cpp_reader): Add counter member. * gcc.dg/cpp/counter-1.c: New test. * gcc.dg/pch/counter-1.c: New test. * gcc.dg/pch/counter-1.hs: New file. * gcc.dg/pch/counter-2.c: New test. * gcc.dg/pch/counter-2.hs: New file. * gcc.dg/pch/counter-3.c: New test. * gcc.dg/pch/counter-3.hs: New file. * doc/cpp.texi (Common Predefined Macros): Add __COUNTER__ description. From-SVN: r125041
This commit is contained in:
parent
e1b871ecc1
commit
a702045a24
16 changed files with 154 additions and 1 deletions
|
@ -310,6 +310,7 @@ static const struct builtin builtin_array[] =
|
|||
B("__BASE_FILE__", BT_BASE_FILE),
|
||||
B("__LINE__", BT_SPECLINE),
|
||||
B("__INCLUDE_LEVEL__", BT_INCLUDE_LEVEL),
|
||||
B("__COUNTER__", BT_COUNTER),
|
||||
/* Keep builtins not used for -traditional-cpp at the end, and
|
||||
update init_builtins() if any more are added. */
|
||||
B("_Pragma", BT_PRAGMA),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue