diff options
author | Jakub Jelinek <jakub@redhat.com> | 2010-06-11 20:37:34 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2010-06-11 20:37:34 +0200 |
commit | 8e680db5b64c74ef131f7eb6a50902cf2134f845 (patch) | |
tree | 202ae75e58b19cf2da840d299ec67598a6eef33b /libcpp/include | |
parent | 7b14477e384de8841d377e3c3254f9f3bcc9aecb (diff) | |
download | gcc-8e680db5b64c74ef131f7eb6a50902cf2134f845.tar.gz |
cpplib.h (struct cpp_callbacks): Add user_builtin_macro callback.
* include/cpplib.h (struct cpp_callbacks): Add user_builtin_macro
callback.
(enum cpp_builtin_type): Add BT_FIRST_USER and BT_LAST_USER.
(cpp_macro_definition): Remove const qual from second argument.
* macro.c (enter_macro_context): Call user_builtin_macro callback for
NODE_BUILTIN !NODE_USED macros.
(warn_of_redefinition): Likewise. Remove const qual from second
argument.
(cpp_macro_definition): Likewise.
* pch.c (write_macdef, save_macros): Call user_builtin_macro callback
for NODE_BUILTIN !NODE_USED macros.
* c-family/c-cppbuiltin.c: Include cpp-id-data.h.
(lazy_hex_fp_values, lazy_hex_fp_value_count): New variables.
(lazy_hex_fp_value): New function.
(builtin_define_with_hex_fp_value): Provide definitions lazily.
* Makefile.in (c-family/c-cppbuiltin.o): Depend on $(CPP_ID_DATA_H).
From-SVN: r160626
Diffstat (limited to 'libcpp/include')
-rw-r--r-- | libcpp/include/cpplib.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h index ba79262f6cd..87d368e2925 100644 --- a/libcpp/include/cpplib.h +++ b/libcpp/include/cpplib.h @@ -509,6 +509,9 @@ struct cpp_callbacks /* Called whenever a macro is expanded or tested. Second argument is the location of the start of the current expansion. */ void (*used) (cpp_reader *, source_location, cpp_hashnode *); + + /* Callback that can change a user builtin into normal macro. */ + bool (*user_builtin_macro) (cpp_reader *, cpp_hashnode *); }; #ifdef VMS @@ -599,7 +602,9 @@ enum cpp_builtin_type BT_STDC, /* `__STDC__' */ BT_PRAGMA, /* `_Pragma' operator */ BT_TIMESTAMP, /* `__TIMESTAMP__' */ - BT_COUNTER /* `__COUNTER__' */ + BT_COUNTER, /* `__COUNTER__' */ + BT_FIRST_USER, /* User defined builtin macros. */ + BT_LAST_USER = BT_FIRST_USER + 31 }; #define CPP_HASHNODE(HNODE) ((cpp_hashnode *) (HNODE)) @@ -726,7 +731,7 @@ extern const cpp_token *cpp_get_token (cpp_reader *); extern const cpp_token *cpp_get_token_with_location (cpp_reader *, source_location *); extern const unsigned char *cpp_macro_definition (cpp_reader *, - const cpp_hashnode *); + cpp_hashnode *); extern void _cpp_backup_tokens (cpp_reader *, unsigned int); extern const cpp_token *cpp_peek_token (cpp_reader *, int); |