From 1279cb208ceef17d997713835ff642cc5ebd1fb6 Mon Sep 17 00:00:00 2001 From: LaurentGom Date: Fri, 5 Nov 2010 14:09:29 +0000 Subject: [PATCH] Minor modifications to Config.hpp git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1615 4e206d99-4929-0410-ac5d-dfc041789085 --- include/SFML/Config.hpp | 42 ++++++++++++++++------------------------- 1 file changed, 16 insertions(+), 26 deletions(-) diff --git a/include/SFML/Config.hpp b/include/SFML/Config.hpp index 67846da3..3d2ed3d1 100644 --- a/include/SFML/Config.hpp +++ b/include/SFML/Config.hpp @@ -93,42 +93,32 @@ //////////////////////////////////////////////////////////// // Define portable import / export macros //////////////////////////////////////////////////////////// -#if defined(SFML_SYSTEM_WINDOWS) +#if defined(SFML_SYSTEM_WINDOWS) && !defined(SFML_STATIC) - #ifndef SFML_STATIC + #ifdef SFML_EXPORTS - // Windows platforms - #ifdef SFML_EXPORTS - - // From DLL side, we must export - #define SFML_API __declspec(dllexport) - - #else - - // From client application side, we must import - #define SFML_API __declspec(dllimport) - - #endif - - // For Visual C++ compilers, we also need to turn off this annoying C4251 warning. - // You can read lots ot different things about it, but the point is the code will - // just work fine, and so the simplest way to get rid of this warning is to disable it - #ifdef _MSC_VER - - #pragma warning(disable : 4251) - - #endif + // From DLL side, we must export + #define SFML_API __declspec(dllexport) #else - // No specific directive needed for static build - #define SFML_API + // From client application side, we must import + #define SFML_API __declspec(dllimport) + + #endif + + // For Visual C++ compilers, we also need to turn off this annoying C4251 warning. + // You can read lots ot different things about it, but the point is the code will + // just work fine, and so the simplest way to get rid of this warning is to disable it + #ifdef _MSC_VER + + #pragma warning(disable : 4251) #endif #else - // Other platforms don't need to define anything + // Other platforms and static build don't need these export macros #define SFML_API #endif