diff --git a/CMakeLists.txt b/CMakeLists.txt index 72694c72a..9635194d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -412,7 +412,7 @@ add_library(uuid-shared SHARED ${UUID_SRC}) set_property(TARGET uuid-shared PROPERTY C_VISIBILITY_PRESET hidden) set_property(TARGET uuid-shared PROPERTY VISIBILITY_INLINES_HIDDEN ON) target_compile_definitions(uuid-shared PUBLIC OC_SHARED_LIBRARY) -set_target_properties(uuid-shared PROPERTIES DEFINE_SYMBOL "OC_SHARED_LIBRARY_EXPORTS") +set_target_properties(uuid-shared PROPERTIES DEFINE_SYMBOL "OC_SHARED_LIBRARY_EXPORT") target_include_directories(uuid-shared PUBLIC $ $ @@ -453,7 +453,7 @@ endif() set_property(TARGET client-python-shared PROPERTY C_VISIBILITY_PRESET hidden) set_property(TARGET client-python-shared PROPERTY VISIBILITY_INLINES_HIDDEN ON) target_compile_definitions(client-python-shared PUBLIC OC_SHARED_LIBRARY) -set_target_properties(client-python-shared PROPERTIES DEFINE_SYMBOL "OC_SHARED_LIBRARY_EXPORTS") +set_target_properties(client-python-shared PROPERTIES DEFINE_SYMBOL "OC_SHARED_LIBRARY_EXPORT") set_target_properties(client-python-shared PROPERTIES OUTPUT_NAME "iotivity-lite-client-python" VERSION ${PROJECT_VERSION} diff --git a/include/oc_export.h b/include/oc_export.h index 672dec1c4..48baf819b 100644 --- a/include/oc_export.h +++ b/include/oc_export.h @@ -17,24 +17,24 @@ #ifndef OC_EXPORT_H #define OC_EXPORT_H -#if defined _WIN32 || defined __CYGWIN__ || defined __MINGW32__ +#ifdef _WIN32 #define OC_EXPORT __declspec(dllexport) #define OC_IMPORT __declspec(dllimport) -#elif __GNUC__ >= 4 +#elif (defined __GNUC__ && __GNUC__ >= 4) #define OC_EXPORT __attribute__((visibility("default"))) #define OC_IMPORT -#else /* __GNUC__ < 4 */ +#else /* !__GNUC__ || __GNUC__ < 4 */ #warning "Shared libraries not supported" #define OC_EXPORT #define OC_IMPORT -#endif /* defined _WIN32 || defined __CYGWIN__ || defined __MINGW32__ */ +#endif /* _WIN32 */ #ifdef OC_SHARED_LIBRARY -#ifdef OC_SHARED_LIBRARY_EXPORTS +#ifdef OC_SHARED_LIBRARY_EXPORT #define OC_API OC_EXPORT -#else /* !OC_SHARED_LIBRARY_EXPORTS*/ +#else /* !OC_SHARED_LIBRARY_EXPORT*/ #define OC_API OC_IMPORT -#endif /* OC_SHARED_LIBRARY_EXPORTS */ +#endif /* OC_SHARED_LIBRARY_EXPORT */ #else /* !OC_SHARED_LIBRARY */ #define OC_API #endif /* OC_SHARED_LIBRARY */