File tree 3 files changed +16
-5
lines changed 3 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -60,11 +60,15 @@ impl ParseCallbacks for MacroCallback {
60
60
}
61
61
}
62
62
63
- fn int_macro ( & self , _name : & str , _value : i64 ) -> Option < IntKind > {
64
- Some ( IntKind :: Custom {
65
- name : "crate::MacroInteger" ,
66
- is_signed : true ,
67
- } )
63
+ fn int_macro ( & self , name : & str , _value : i64 ) -> Option < IntKind > {
64
+ match name {
65
+ "TESTMACRO_CUSTOMINTKIND_PATH" => Some ( IntKind :: Custom {
66
+ name : "crate::MacroInteger" ,
67
+ is_signed : true ,
68
+ } ) ,
69
+
70
+ _ => None ,
71
+ }
68
72
}
69
73
}
70
74
Original file line number Diff line number Diff line change 5
5
#define TESTMACRO_INTEGER 42
6
6
#define TESTMACRO_STRING " Hello Preprocessor!"
7
7
#define TESTMACRO_STRING_EXPANDED TESTMACRO_STRING
8
+ #define TESTMACRO_CUSTOMINTKIND_PATH 123
8
9
9
10
#include < cwchar>
10
11
Original file line number Diff line number Diff line change @@ -244,3 +244,9 @@ fn test_item_rename() {
244
244
member : bindings:: bar { foo : 2 } ,
245
245
} ;
246
246
}
247
+
248
+ #[ test]
249
+ fn test_macro_customintkind_path ( ) {
250
+ let v: & std:: any:: Any = & bindings:: TESTMACRO_CUSTOMINTKIND_PATH ;
251
+ assert ! ( v. is:: <MacroInteger >( ) )
252
+ }
You can’t perform that action at this time.
0 commit comments