Derive-C
Loading...
Searching...
No Matches
def.h
Go to the documentation of this file.
1// JUSTIFY: No mocking from within a struct
2// - Cannot forward declare the function within the struct body.
3// - Cannot put the function pointer after the real definition
4// without making the function body a macro argument
5// So we just disable.
6#if defined EXPAND_IN_STRUCT
7 #if defined DC_MOCKABLE
8 // JUSTIFY: just checking mockable
9 // - All are defined in `mock.h`
10 #pragma push_macro("DC_MOCKABLE_DECLARE")
11 #pragma push_macro("DC_MOCKABLE_DEFINE")
12 #pragma push_macro("DC_MOCKABLE_ENABLED")
13
14 #undef DC_MOCKABLE_DECLARE // [DERIVE-C] argument
15 #undef DC_MOCKABLE_DEFINE // [DERIVE-C] argument
16 #undef DC_MOCKABLE_ENABLED // [DERIVE-C] argument
17
18 #define DC_MOCKABLE_DECLARE(ret, name, args)
19 #define DC_MOCKABLE_DEFINE(ret, name, args) static ret name args
20 #define DC_MOCKABLE_ENABLED(name) false
21 #endif
22#endif