- /* Called to emit a diagnostic if client_diagnostic option is true.
- This callback receives the translated message. */
- void (*error) (cpp_reader *, int, const char *, va_list *)
- ATTRIBUTE_FPTR_PRINTF(3,0);
+ /* Context-sensitive macro support. Returns macro (if any) that should
+ be expanded. */
+ cpp_hashnode * (*macro_to_expand) (cpp_reader *, const cpp_token *);
+
+ /* Called to emit a diagnostic. This callback receives the
+ translated message. */
+ bool (*error) (cpp_reader *, int, int, source_location, unsigned int,
+ const char *, va_list *)
+ ATTRIBUTE_FPTR_PRINTF(6,0);
+
+ /* Callbacks for when a macro is expanded, or tested (whether
+ defined or not at the time) in #ifdef, #ifndef or "defined". */
+ void (*used_define) (cpp_reader *, source_location, cpp_hashnode *);
+ void (*used_undef) (cpp_reader *, source_location, cpp_hashnode *);
+ /* Called before #define and #undef or other macro definition
+ changes are processed. */
+ void (*before_define) (cpp_reader *);
+ /* 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 *);