Go to the documentation of this file.
7 #include <mc_rtc/macros/deprecated.h>
11 #define MC_RTC_STRINGIFY_(x) #x
12 #define MC_RTC_STRINGIFY(x) MC_RTC_STRINGIFY_(x)
15 # define MC_RTC_PRAGMA(x) _Pragma(MC_RTC_STRINGIFY(x))
19 #define MC_RTC_WN(fun, ...) \
20 MC_RTC_PRAGMA(message(__FILE__ "[" STRING(__LINE__) "] Incorrect number of arguments when invoking macro " STRING( \
21 fun) ". Call is ignored"))
24 #define MC_RTC_MAP2_0(fun)
25 #define MC_RTC_MAP2_1(fun, X, Y) fun(X, Y)
26 #define MC_RTC_MAP2_2(fun, X, Y, ...) fun(X, Y) MC_RTC_PP_ID(MC_RTC_MAP2_1(fun, __VA_ARGS__))
27 #define MC_RTC_MAP2_3(fun, X, Y, ...) fun(X, Y) MC_RTC_PP_ID(MC_RTC_MAP2_2(fun, __VA_ARGS__))
28 #define MC_RTC_MAP2_4(fun, X, Y, ...) fun(X, Y) MC_RTC_PP_ID(MC_RTC_MAP2_3(fun, __VA_ARGS__))
29 #define MC_RTC_MAP2_5(fun, X, Y, ...) fun(X, Y) MC_RTC_PP_ID(MC_RTC_MAP2_4(fun, __VA_ARGS__))
30 #define MC_RTC_MAP2_6(fun, X, Y, ...) fun(X, Y) MC_RTC_PP_ID(MC_RTC_MAP2_5(fun, __VA_ARGS__))
31 #define MC_RTC_MAP2_7(fun, X, Y, ...) fun(X, Y) MC_RTC_PP_ID(MC_RTC_MAP2_6(fun, __VA_ARGS__))
32 #define MC_RTC_MAP2_8(fun, X, Y, ...) fun(X, Y) MC_RTC_PP_ID(MC_RTC_MAP2_7(fun, __VA_ARGS__))
33 #define MC_RTC_MAP2_9(fun, X, Y, ...) fun(X, Y) MC_RTC_PP_ID(MC_RTC_MAP2_8(fun, __VA_ARGS__))
34 #define MC_RTC_MAP2_10(fun, X, Y, ...) fun(X, Y) MC_RTC_PP_ID(MC_RTC_MAP2_9(fun, __VA_ARGS__))
36 #define MC_RTC_GET_MACRO(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, \
41 #define MC_RTC_MAP_TWO_ARGS(fun, ...) \
42 MC_RTC_PP_ID(MC_RTC_GET_MACRO(_0, __VA_ARGS__, MC_RTC_MAP2_10, MC_RTC_WN, MC_RTC_MAP2_9, MC_RTC_WN, MC_RTC_MAP2_8, \
43 MC_RTC_WN, MC_RTC_MAP2_7, MC_RTC_WN, MC_RTC_MAP2_6, MC_RTC_WN, MC_RTC_MAP2_5, \
44 MC_RTC_WN, MC_RTC_MAP2_4, MC_RTC_WN, MC_RTC_MAP2_3, MC_RTC_WN, MC_RTC_MAP2_2, \
45 MC_RTC_WN, MC_RTC_MAP2_1, MC_RTC_WN, MC_RTC_MAP2_0, MC_RTC_MAP2_0)(fun, __VA_ARGS__))
48 # define MC_RTC_diagnostic_push _Pragma("GCC diagnostic push")
49 # define MC_RTC_diagnostic_pop _Pragma("GCC diagnostic pop")
50 # define MC_RTC_GCC_diagnostic_ignored(x) MC_RTC_PRAGMA(GCC diagnostic ignored x)
52 # define MC_RTC_ClangOnly_diagnostic_ignored(x) MC_RTC_PRAGMA(GCC diagnostic ignored x)
53 # define MC_RTC_GCCOnly_diagnostic_ignored(x)
55 # define MC_RTC_ClangOnly_diagnostic_ignored(x)
56 # define MC_RTC_GCCOnly_diagnostic_ignored(x) MC_RTC_PRAGMA(GCC diagnostic ignored x)
59 # define MC_RTC_GCC_diagnostic_ignored(x)
60 # define MC_RTC_ClangOnly_diagnostic_ignored(x)
61 # define MC_RTC_GCCOnly_diagnostic_ignored(x)
65 # define MC_RTC_diagnostic_push _Pragma("warning(push)")
66 # define MC_RTC_diagnostic_pop _Pragma("warning(pop)")
67 # define MC_RTC_MSVC_diagnostic_ignored(x) MC_RTC_PRAGMA(warning(disable : x))
69 # define MC_RTC_MSVC_diagnostic_ignored(x)
73 #define MC_RTC_diagnostic_ignored_(c, w) MC_RTC_##c##_diagnostic_ignored(w)
76 #define MC_RTC_diagnostic_ignored(...) MC_RTC_MAP_TWO_ARGS(MC_RTC_diagnostic_ignored_, __VA_ARGS__)