From fa4102004c1b11100b520da09a97522193787654 Mon Sep 17 00:00:00 2001 From: Kolan Sh Date: Fri, 25 May 2012 19:19:28 +0400 Subject: [PATCH] Fix for cmake_lib to build under Gcc, Borland, MinGW. --- c/cmake_lib/libmean/mean.c | 4 +++- c/cmake_lib/libmean/mean.h | 10 +++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/c/cmake_lib/libmean/mean.c b/c/cmake_lib/libmean/mean.c index e4d580e..8755b77 100644 --- a/c/cmake_lib/libmean/mean.c +++ b/c/cmake_lib/libmean/mean.c @@ -1,5 +1,7 @@ -//#include +#if defined (__BORLANDC__) #define __DLL_MEAN__ +#endif + #include "mean.h" double DLL_SPEC mean(double a, double b) { diff --git a/c/cmake_lib/libmean/mean.h b/c/cmake_lib/libmean/mean.h index 5df4d3d..52dc490 100644 --- a/c/cmake_lib/libmean/mean.h +++ b/c/cmake_lib/libmean/mean.h @@ -1,7 +1,11 @@ -#if defined(__DLL_MEAN__) - #define DLL_SPEC __declspec(dllexport) +#if defined (__BORLANDC__) + #if defined(__DLL_MEAN__) + #define DLL_SPEC __declspec(dllexport) + #else + #define DLL_SPEC __declspec(dllimport) + #endif #else - #define DLL_SPEC __declspec(dllimport) + #define DLL_SPEC #endif