From 7280e10e8bfa507953d8c823abd502db98c514fa Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Wed, 8 Oct 2014 14:29:34 +0200 Subject: some fixes on Windows --- include/luaglue/LuaGlueExportable.hpp | 26 ++++++++++++++++++++++++++ include/luaglue/LuaVM.hpp | 16 +++++++++------- include/util/StringUtils.hpp | 4 +++- include/util/win32/errormsg.hpp | 2 +- include/util/win32/stringutils.hpp | 2 +- 5 files changed, 40 insertions(+), 10 deletions(-) create mode 100644 include/luaglue/LuaGlueExportable.hpp (limited to 'include') diff --git a/include/luaglue/LuaGlueExportable.hpp b/include/luaglue/LuaGlueExportable.hpp new file mode 100644 index 0000000..134e3f0 --- /dev/null +++ b/include/luaglue/LuaGlueExportable.hpp @@ -0,0 +1,26 @@ +#ifndef __LUAGLUE_EXPORTABLE_H +#define __LUAGLUE_EXPORTABLE_H + +#ifndef _WIN32 + +#define LUAGLUE_DLL_VISIBLE + +#else + +#ifdef SHARED + +#ifdef BUILDING_LUAGLUE +#define LUAGLUE_DLL_VISIBLE __declspec(dllexport) +#else +#define LUAGLUE_DLL_VISIBLE __declspec(dllimport) +#endif + +#else + +#define LUAGLUE_DLL_VISIBLE + +#endif // BUILDING_LUAGLUE + +#endif // _WIN32 + +#endif diff --git a/include/luaglue/LuaVM.hpp b/include/luaglue/LuaVM.hpp index baa5bca..bd2fd21 100755 --- a/include/luaglue/LuaVM.hpp +++ b/include/luaglue/LuaVM.hpp @@ -1,6 +1,8 @@ #ifndef __LUA_VM_H #define __LUA_VM_H +#include "LuaGlueExportable.hpp" + #include "lua.hpp" #include @@ -8,15 +10,15 @@ class LuaVM { public: - LuaVM( ); - ~LuaVM( ); + LUAGLUE_DLL_VISIBLE LuaVM( ); + LUAGLUE_DLL_VISIBLE ~LuaVM( ); - void loadSource( const char *sourceFilename ); - void executeMain( ); - void dumpState( ); - void fullGarbageCollect( ); + LUAGLUE_DLL_VISIBLE void loadSource( const char *sourceFilename ); + LUAGLUE_DLL_VISIBLE void executeMain( ); + LUAGLUE_DLL_VISIBLE void dumpState( ); + LUAGLUE_DLL_VISIBLE void fullGarbageCollect( ); - lua_State *handle( ); + LUAGLUE_DLL_VISIBLE lua_State *handle( ); private: void initialize( ); diff --git a/include/util/StringUtils.hpp b/include/util/StringUtils.hpp index c6b9f87..d0c832e 100644 --- a/include/util/StringUtils.hpp +++ b/include/util/StringUtils.hpp @@ -3,6 +3,8 @@ #include -bool stringicasecmp( const std::string &s1, const std::string &s2 ); +#include "util/UtilExportable.hpp" + +UTIL_DLL_VISIBLE bool stringicasecmp( const std::string &s1, const std::string &s2 ); #endif diff --git a/include/util/win32/errormsg.hpp b/include/util/win32/errormsg.hpp index 93ce3b7..7bdc582 100755 --- a/include/util/win32/errormsg.hpp +++ b/include/util/win32/errormsg.hpp @@ -3,7 +3,7 @@ #include -#include "UtilExportable.hpp" +#include "util/UtilExportable.hpp" UTIL_DLL_VISIBLE std::string getLastError( ); diff --git a/include/util/win32/stringutils.hpp b/include/util/win32/stringutils.hpp index 8f293dd..976c5cf 100755 --- a/include/util/win32/stringutils.hpp +++ b/include/util/win32/stringutils.hpp @@ -3,7 +3,7 @@ #include -#include "UtilExportable.hpp" +#include "util/UtilExportable.hpp" UTIL_DLL_VISIBLE std::wstring s2ws( const std::string &s ); -- cgit v1.2.3-54-g00ecf