diff options
Diffstat (limited to 'src/components/include/utils/macro.h')
-rw-r--r-- | src/components/include/utils/macro.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/components/include/utils/macro.h b/src/components/include/utils/macro.h index 0e029e4b06..4cf76fe022 100644 --- a/src/components/include/utils/macro.h +++ b/src/components/include/utils/macro.h @@ -113,6 +113,13 @@ return; \ } +#define EXPORT_FUNCTION(TypeName) extern "C" TypeName* Create(); + +#define EXPORT_FUNCTION_IMPL(TypeName) \ + extern "C" TypeName* Create() { \ + return new TypeName(); \ + } + #define NOTREACHED() DCHECK(!"Unreachable code") // Allows to perform static check that virtual function from base class is @@ -134,6 +141,8 @@ #ifdef BUILD_TESTS #define FRIEND_TEST(test_case_name, test_name) \ friend class test_case_name##_##test_name##_Test -#endif +#else // BUILD_TESTS +#define FRIEND_TEST(test_case_name, test_name) +#endif // BUILD_TESTS #endif // SRC_COMPONENTS_INCLUDE_UTILS_MACRO_H_ |