Go to the documentation of this file. 20 #define DECLARE_UNION_STATIC_UNION_IMPL(type, name) \ 27 #define DECLARE_UNION_STATIC_UNION_ARRAY_IMPL(type, size, name) \ 34 #define DEFINE_UNION_STATIC_UNION_IMPL(type, name, var) \ 35 DECLARE_UNION_STATIC_UNION_IMPL(type, name) var; 37 #define DEFINE_UNION_STATIC_UNION_CONST_IMPL(type, name, var) \ 38 DECLARE_UNION_STATIC_UNION_IMPL(type, name) const var; 40 #define DEFINE_UNION_STATIC_UNION_CONST_ARRAY_IMPL(type, size, name, var) \ 41 DECLARE_UNION_STATIC_UNION_ARRAY_IMPL(type, size, name) const var; 45 #define DEFINE_UNION_STATIC_CONSTRUCTOR_IMPL(type, name, var) \ 46 __attribute__((__constructor__)) \ 47 void init##name##Union() { \ 48 new (const_cast<type*>(&var.data)) type(); \ 51 #define DEFINE_UNION_STATIC_CONSTRUCTOR_ARG_IMPL(type, name, var, ...) \ 52 __attribute__((__constructor__)) \ 53 void init##name##Union() { \ 54 new (const_cast<type*>(&var.data)) type(__VA_ARGS__); \ 62 #define DEFINE_UNION_STATIC(type, name, var) \ 63 DEFINE_UNION_STATIC_UNION_IMPL(type, name, var) \ 64 DEFINE_UNION_STATIC_CONSTRUCTOR_IMPL(type, name, var) 66 #define DEFINE_UNION_STATIC_ARGS(type, name, var, ...) \ 67 DEFINE_UNION_STATIC_UNION_IMPL(type, name, var) \ 68 DEFINE_UNION_STATIC_CONSTRUCTOR_ARG_IMPL(type, name, var, __VA_ARGS__) 70 #define DEFINE_UNION_STATIC_NO_INIT(type, name, var) \ 71 DEFINE_UNION_STATIC_UNION_IMPL(type, name, var) 74 #define DEFINE_UNION_STATIC_CONST(type, name, var) \ 75 DEFINE_UNION_STATIC_UNION_CONST_IMPL(type, name, var) \ 76 DEFINE_UNION_STATIC_CONSTRUCTOR_IMPL(type, name, var) 78 #define DEFINE_UNION_STATIC_CONST_ARGS(type, name, var, ...) \ 79 DEFINE_UNION_STATIC_UNION_CONST_IMPL(type, name, var) \ 80 DEFINE_UNION_STATIC_CONSTRUCTOR_ARG_IMPL(type, name, var, __VA_ARGS__) 82 #define DEFINE_UNION_STATIC_CONST_NO_INIT(type, name, var) \ 83 DEFINE_UNION_STATIC_UNION_CONST_IMPL(type, name, var) 85 #define DEFINE_UNION_STATIC_CONST_ARRAY_NO_INIT(type, size, name, var) \ 86 DEFINE_UNION_STATIC_UNION_CONST_ARRAY_IMPL(type, size, name, var) 99 #define DECLARE_UNION_STATIC(type, name) \ 100 DECLARE_UNION_STATIC_UNION_IMPL(type, name) 102 #define IMPLEMENT_DECLARED_UNION_STATIC(type, unionName, name, var) \ 103 unionName##Union var; \ 104 DEFINE_UNION_STATIC_CONSTRUCTOR_ARG_IMPL(type, name, var) 106 #define IMPLEMENT_DECLARED_UNION_STATIC_ARGS(type, unionName, name, var, ...) \ 107 unionName##Union var; \ 108 DEFINE_UNION_STATIC_CONSTRUCTOR_ARG_IMPL(type, name, var, __VA_ARGS__)