Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SharedFunc.hpp
Go to the documentation of this file.
1 #pragma once
2 
4 
5 // SKIP_FUNCTION_MACROS identifies all uppercase, single line macros without semicolon behind it.
6 #ifdef GLUEGEN_PASS
7 
9 inline bool function_args_dummy(const char *name, SharedOption a) { return true; }
10 
11 
15 #define SharedFunc_1_ARGS(name, options) static bool __function_dummy_##name = function_args_dummy(#name, options)
16 #define SharedFunc_2_ARGS(name) static SharedOption __func_options_dummy_##name; static bool __function_dummy_##name = function_args_dummy(#name, __func_options_dummy_##name)
17 
18 #define GET_3RD_ARG(arg1, arg2, arg3, ...) arg3
19 #define SharedFunc_MACRO_CHOOSER(...) \
20  GET_3RD_ARG(__VA_ARGS__, SharedFunc_1_ARGS, SharedFunc_2_ARGS, )
21 
22 #define SharedFunc(...) SharedFunc_MACRO_CHOOSER(__VA_ARGS__)(__VA_ARGS__)
23 
24 #else
25 #define SharedFunc(name, ...)
26 #endif
27 
28 
Definition: SharedOptions.hpp:6