From d084deeebf60bfb52480430969a46447821a1eda Mon Sep 17 00:00:00 2001 From: rude Date: Fri, 12 Feb 2010 20:59:32 +0100 Subject: [PATCH] Added project files for love.thread on Windows. Also a minor fix to make love.thread builable as a standalone DLL. --- platform/msvc2008/graphics/graphics.vcproj | 12 ++ platform/msvc2008/love.sln | 9 + platform/msvc2008/love.vcproj | 76 ++++++++ platform/msvc2008/thread/thread.vcproj | 211 +++++++++++++++++++++ src/modules/thread/sdl/Thread.cpp | 9 + src/modules/thread/sdl/wrap_Thread.cpp | 1 + 6 files changed, 318 insertions(+) create mode 100644 platform/msvc2008/thread/thread.vcproj diff --git a/platform/msvc2008/graphics/graphics.vcproj b/platform/msvc2008/graphics/graphics.vcproj index 6f520194b..c1b489bc4 100644 --- a/platform/msvc2008/graphics/graphics.vcproj +++ b/platform/msvc2008/graphics/graphics.vcproj @@ -615,6 +615,18 @@ RelativePath="..\..\..\src\modules\graphics\Graphics.h" > + + + + + diff --git a/platform/msvc2008/love.sln b/platform/msvc2008/love.sln index 674311b5a..77ce22842 100644 --- a/platform/msvc2008/love.sln +++ b/platform/msvc2008/love.sln @@ -77,6 +77,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lovedll", "lovedll\lovedll. {8273822F-45A4-4BE3-82F3-B8B3223C578C} = {8273822F-45A4-4BE3-82F3-B8B3223C578C} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "thread", "thread\thread.vcproj", "{0BD34470-EB9D-4D37-A398-F46FC97C017A}" + ProjectSection(ProjectDependencies) = postProject + {8273822F-45A4-4BE3-82F3-B8B3223C578C} = {8273822F-45A4-4BE3-82F3-B8B3223C578C} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -147,6 +152,10 @@ Global {2863FF8A-153F-46E0-8E71-2E58F3809E9B}.Debug|Win32.Build.0 = Debug|Win32 {2863FF8A-153F-46E0-8E71-2E58F3809E9B}.Release|Win32.ActiveCfg = Release|Win32 {2863FF8A-153F-46E0-8E71-2E58F3809E9B}.Release|Win32.Build.0 = Release|Win32 + {0BD34470-EB9D-4D37-A398-F46FC97C017A}.Debug|Win32.ActiveCfg = Debug|Win32 + {0BD34470-EB9D-4D37-A398-F46FC97C017A}.Debug|Win32.Build.0 = Debug|Win32 + {0BD34470-EB9D-4D37-A398-F46FC97C017A}.Release|Win32.ActiveCfg = Release|Win32 + {0BD34470-EB9D-4D37-A398-F46FC97C017A}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/platform/msvc2008/love.vcproj b/platform/msvc2008/love.vcproj index e9c77141b..46ec8e992 100644 --- a/platform/msvc2008/love.vcproj +++ b/platform/msvc2008/love.vcproj @@ -658,6 +658,26 @@ RelativePath="..\..\src\modules\graphics\Graphics.h" > + + + + + + + + @@ -3209,6 +3229,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/modules/thread/sdl/Thread.cpp b/src/modules/thread/sdl/Thread.cpp index 1ca9fba7d..78a85bae5 100644 --- a/src/modules/thread/sdl/Thread.cpp +++ b/src/modules/thread/sdl/Thread.cpp @@ -18,16 +18,23 @@ * 3. This notice may not be removed or altered from any source distribution. **/ +#include + #include "Thread.h" +#ifdef LOVE_BUILD_STANDALONE extern "C" int luaopen_love(lua_State * L); +#endif // LOVE_BUILD_STANDALONE + int threadfunc(const char *data) { lua_State * L = lua_open(); luaL_openlibs(L); +#ifdef LOVE_BUILD_STANDALONE love::luax_preload(L, luaopen_love, "love"); luaopen_love(L); +#endif // LOVE_BUILD_STANDALONE luaL_dostring(L, data); lua_close(L); return 0; @@ -105,6 +112,8 @@ namespace sdl { list[c] = i->second; } + + return NULL; } void ThreadModule::unregister(std::string name) diff --git a/src/modules/thread/sdl/wrap_Thread.cpp b/src/modules/thread/sdl/wrap_Thread.cpp index ce0f6085c..091dd262a 100644 --- a/src/modules/thread/sdl/wrap_Thread.cpp +++ b/src/modules/thread/sdl/wrap_Thread.cpp @@ -79,6 +79,7 @@ namespace sdl int w_getThreads(lua_State *L) { + return 0; } int w_getThread(lua_State *L)