From 53e5e8cb0143736eb69820220a220a72cdd616de Mon Sep 17 00:00:00 2001 From: Transporter Date: Thu, 30 Apr 2020 19:25:47 +0200 Subject: Fix issure #138: DLL export fails --- include/tgbot/export.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include') diff --git a/include/tgbot/export.h b/include/tgbot/export.h index 55789d9..3178a0e 100644 --- a/include/tgbot/export.h +++ b/include/tgbot/export.h @@ -2,7 +2,19 @@ #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 +#endif #endif //TGBOT_EXPORT_H -- cgit v1.2.3 From 68a49a080cb7b9484b0c8330cf15a99084e5f63f Mon Sep 17 00:00:00 2001 From: Transporter Date: Thu, 30 Apr 2020 20:25:53 +0200 Subject: Indentations and GCC attribute added --- include/tgbot/export.h | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) (limited to 'include') diff --git a/include/tgbot/export.h b/include/tgbot/export.h index 3178a0e..b38f1fc 100644 --- a/include/tgbot/export.h +++ b/include/tgbot/export.h @@ -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 -- cgit v1.2.3 From 3b7da8cd1e2f77d73cc19533fc657ba10a80c8cd Mon Sep 17 00:00:00 2001 From: Transporter Date: Sat, 2 May 2020 00:15:17 +0200 Subject: Fix mistake FOX and reorder EXPORT/IMPORT --- include/tgbot/export.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/tgbot/export.h b/include/tgbot/export.h index b38f1fc..1bfb503 100644 --- a/include/tgbot/export.h +++ b/include/tgbot/export.h @@ -4,21 +4,21 @@ #ifndef TGBOT_API #ifdef TGBOT_DLL #if defined _WIN32 || defined __CYGWIN__ - #define TGBOT_HELPER_DLL_IMPORT __declspec(dllimport) #define TGBOT_HELPER_DLL_EXPORT __declspec(dllexport) + #define TGBOT_HELPER_DLL_IMPORT __declspec(dllimport) #else #if __GNUC__ >= 4 - #define TGBOT_HELPER_DLL_IMPORT __attribute__ ((visibility ("default"))) #define TGBOT_HELPER_DLL_EXPORT __attribute__ ((visibility ("default"))) + #define TGBOT_HELPER_DLL_IMPORT __attribute__ ((visibility ("default"))) #else - #define TGBOT_HELPER_DLL_IMPORT #define TGBOT_HELPER_DLL_EXPORT + #define TGBOT_HELPER_DLL_IMPORT #endif #endif #ifdef TgBot_EXPORTS #define TGBOT_API TGBOT_HELPER_DLL_EXPORT #else - #define FOX_API TGBOT_HELPER_DLL_IMPORT + #define TGBOT_API TGBOT_HELPER_DLL_IMPORT #endif #else #define TGBOT_API -- cgit v1.2.3