123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- #ifndef BASE_EXPORT_TEMPLATE_H_
- #define BASE_EXPORT_TEMPLATE_H_
- #define EXPORT_TEMPLATE_DECLARE(foo_export) \
- EXPORT_TEMPLATE_INVOKE(DECLARE, EXPORT_TEMPLATE_STYLE(foo_export), foo_export)
- #define EXPORT_TEMPLATE_DEFINE(foo_export) \
- EXPORT_TEMPLATE_INVOKE(DEFINE, EXPORT_TEMPLATE_STYLE(foo_export), foo_export)
- #define EXPORT_TEMPLATE_INVOKE(which, style, foo_export) \
- EXPORT_TEMPLATE_INVOKE_2(which, style, foo_export)
- #define EXPORT_TEMPLATE_INVOKE_2(which, style, foo_export) \
- EXPORT_TEMPLATE_##which##_##style(foo_export)
- #define EXPORT_TEMPLATE_DECLARE_DEFAULT(foo_export) foo_export
- #define EXPORT_TEMPLATE_DEFINE_DEFAULT(foo_export)
- #define EXPORT_TEMPLATE_DECLARE_EXPORT_DLLEXPORT(foo_export)
- #define EXPORT_TEMPLATE_DEFINE_EXPORT_DLLEXPORT(foo_export) foo_export
- #define EXPORT_TEMPLATE_STYLE(foo_export) EXPORT_TEMPLATE_STYLE_2(foo_export)
- #define EXPORT_TEMPLATE_STYLE_2(foo_export) \
- EXPORT_TEMPLATE_STYLE_MATCH_foj3FJo5StF0OvIzl7oMxA##foo_export
- #define EXPORT_TEMPLATE_STYLE_MATCH_foj3FJo5StF0OvIzl7oMxA DEFAULT
- #define EXPORT_TEMPLATE_STYLE_MATCH_foj3FJo5StF0OvIzl7oMxA__attribute__(...) \
- DEFAULT
- #define EXPORT_TEMPLATE_STYLE_MATCH_foj3FJo5StF0OvIzl7oMxA__declspec(arg) \
- EXPORT_TEMPLATE_STYLE_MATCH_DECLSPEC_##arg
- #define EXPORT_TEMPLATE_STYLE_MATCH_DECLSPEC_dllexport EXPORT_DLLEXPORT
- #define EXPORT_TEMPLATE_STYLE_MATCH_DECLSPEC_dllimport DEFAULT
- #define EXPORT_TEMPLATE_TEST(want, foo_export) \
- static_assert( \
- EXPORT_TEMPLATE_INVOKE(TEST_##want, EXPORT_TEMPLATE_STYLE(foo_export), \
- foo_export), \
- #foo_export)
- #define EXPORT_TEMPLATE_TEST_DEFAULT_DEFAULT(...) true
- #define EXPORT_TEMPLATE_TEST_EXPORT_DLLEXPORT_EXPORT_DLLEXPORT(...) true
- EXPORT_TEMPLATE_TEST(DEFAULT, )
- EXPORT_TEMPLATE_TEST(DEFAULT, __attribute__((visibility("default"))))
- EXPORT_TEMPLATE_TEST(EXPORT_DLLEXPORT, __declspec(dllexport))
- EXPORT_TEMPLATE_TEST(DEFAULT, __declspec(dllimport))
- #undef EXPORT_TEMPLATE_TEST
- #undef EXPORT_TEMPLATE_TEST_DEFAULT_DEFAULT
- #undef EXPORT_TEMPLATE_TEST_EXPORT_DLLEXPORT_EXPORT_DLLEXPORT
- #endif
|