diff --git a/bindgen-integration/build.rs b/bindgen-integration/build.rs index 342b2cff45..a17bd6352f 100644 --- a/bindgen-integration/build.rs +++ b/bindgen-integration/build.rs @@ -95,6 +95,16 @@ impl ParseCallbacks for MacroCallback { } *self.seen_funcs.lock().unwrap() += 1; } + "TESTMACRO_FUNCTIONAL_EMPTY_SIMPLE_ARG(x)" => { + if cfg!(feature = "testing_only_libclang_3_8") || + cfg!(feature = "testing_only_libclang_3_9") + { + assert_eq!(value, &[&[b'#']]); + } else { + assert_eq!(value, &[] as &[&[u8]]); + } + *self.seen_funcs.lock().unwrap() += 1; + } "TESTMACRO_FUNCTIONAL_TOKENIZED(a,b,c,d,e)" => { assert_eq!( value, @@ -128,7 +138,7 @@ impl Drop for MacroCallback { ); assert_eq!( *self.seen_funcs.lock().unwrap(), - 4, + 5, "func_macro handle was not called once for all relevant macros" ); } diff --git a/bindgen-integration/cpp/Test.h b/bindgen-integration/cpp/Test.h index 9d81f1ad78..25f673e83b 100644 --- a/bindgen-integration/cpp/Test.h +++ b/bindgen-integration/cpp/Test.h @@ -10,6 +10,7 @@ // different. #define TESTMACRO_NONFUNCTIONAL (TESTMACRO_INTEGER) #define TESTMACRO_FUNCTIONAL_EMPTY(TESTMACRO_INTEGER) +#define TESTMACRO_FUNCTIONAL_EMPTY_SIMPLE_ARG(x) #define TESTMACRO_FUNCTIONAL_NONEMPTY(TESTMACRO_INTEGER)-TESTMACRO_INTEGER // Unusual spacing in the following macro is intentional, to demonstrate // reformatting after tokenization.