Skip to content

Commit

Permalink
Indentations and GCC attribute added
Browse files Browse the repository at this point in the history
  • Loading branch information
OgreTransporter committed Apr 30, 2020
1 parent 2e8398b commit 68a49a0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,6 @@ if(BUILD_DOCUMENTATION)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/doc/html/ TYPE DOC)
endif()

if(MSVC AND BUILD_SHARED_LIBS)
if(BUILD_SHARED_LIBS)
add_definitions(-DTGBOT_DLL)
endif()
34 changes: 21 additions & 13 deletions include/tgbot/export.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,27 @@
#define TGBOT_EXPORT_H

#ifndef TGBOT_API
#ifdef _MSC_VER
#ifdef TGBOT_DLL
#ifdef TgBot_EXPORTS
#define TGBOT_API __declspec(dllexport)
#else
#define TGBOT_API __declspec(dllimport)
#endif
#else
#define TGBOT_API
#endif
#else
#define TGBOT_API
#endif
#ifdef TGBOT_DLL
#if defined _WIN32 || defined __CYGWIN__
#define TGBOT_HELPER_DLL_IMPORT __declspec(dllimport)
#define TGBOT_HELPER_DLL_EXPORT __declspec(dllexport)
#else
#if __GNUC__ >= 4
#define TGBOT_HELPER_DLL_IMPORT __attribute__ ((visibility ("default")))
#define TGBOT_HELPER_DLL_EXPORT __attribute__ ((visibility ("default")))
#else
#define TGBOT_HELPER_DLL_IMPORT
#define TGBOT_HELPER_DLL_EXPORT
#endif
#endif
#ifdef TgBot_EXPORTS
#define TGBOT_API TGBOT_HELPER_DLL_EXPORT
#else
#define FOX_API TGBOT_HELPER_DLL_IMPORT
#endif
#else
#define TGBOT_API
#endif
#endif

#endif //TGBOT_EXPORT_H

0 comments on commit 68a49a0

Please sign in to comment.