From a71299c46b7b53a5f9f11ea2851f8e5b66d2d912 Mon Sep 17 00:00:00 2001 From: Tycho Bickerstaff Date: Sun, 22 Dec 2013 15:41:01 +0000 Subject: fixed rdynamic as its not acctually needed a cmake handles it, looks like the problem was caused by the linux linker accepting the option twice and the os x linker not --- CMakeLists.txt | 7 ------ lib/lua/Makefile | 54 ----------------------------------------- src/OSSupport/Queue.h | 31 +++++++++++++++++++++++ src/WorldStorage/WorldStorage.h | 3 ++- 4 files changed, 33 insertions(+), 62 deletions(-) create mode 100644 src/OSSupport/Queue.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 859575a69..f8c740ae3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -117,12 +117,5 @@ else() endif() set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE_BAK}") -if (NOT WIN32) - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -rdynamic") - set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} -rdynamic") - set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -rdynamic") - set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_PROFILE} -rdynamic") -endif() - add_subdirectory (src) diff --git a/lib/lua/Makefile b/lib/lua/Makefile index d23c39cc1..8c8cf168a 100644 --- a/lib/lua/Makefile +++ b/lib/lua/Makefile @@ -733,54 +733,6 @@ src/ltm.c.s: cd /home/tycho/MCServer && $(MAKE) -f lib/lua/CMakeFiles/lua.dir/build.make lib/lua/CMakeFiles/lua.dir/src/ltm.c.s .PHONY : src/ltm.c.s -src/lua.o: src/lua.c.o -.PHONY : src/lua.o - -# target to build an object file -src/lua.c.o: - cd /home/tycho/MCServer && $(MAKE) -f lib/lua/CMakeFiles/lua.dir/build.make lib/lua/CMakeFiles/lua.dir/src/lua.c.o -.PHONY : src/lua.c.o - -src/lua.i: src/lua.c.i -.PHONY : src/lua.i - -# target to preprocess a source file -src/lua.c.i: - cd /home/tycho/MCServer && $(MAKE) -f lib/lua/CMakeFiles/lua.dir/build.make lib/lua/CMakeFiles/lua.dir/src/lua.c.i -.PHONY : src/lua.c.i - -src/lua.s: src/lua.c.s -.PHONY : src/lua.s - -# target to generate assembly for a file -src/lua.c.s: - cd /home/tycho/MCServer && $(MAKE) -f lib/lua/CMakeFiles/lua.dir/build.make lib/lua/CMakeFiles/lua.dir/src/lua.c.s -.PHONY : src/lua.c.s - -src/luac.o: src/luac.c.o -.PHONY : src/luac.o - -# target to build an object file -src/luac.c.o: - cd /home/tycho/MCServer && $(MAKE) -f lib/lua/CMakeFiles/lua.dir/build.make lib/lua/CMakeFiles/lua.dir/src/luac.c.o -.PHONY : src/luac.c.o - -src/luac.i: src/luac.c.i -.PHONY : src/luac.i - -# target to preprocess a source file -src/luac.c.i: - cd /home/tycho/MCServer && $(MAKE) -f lib/lua/CMakeFiles/lua.dir/build.make lib/lua/CMakeFiles/lua.dir/src/luac.c.i -.PHONY : src/luac.c.i - -src/luac.s: src/luac.c.s -.PHONY : src/luac.s - -# target to generate assembly for a file -src/luac.c.s: - cd /home/tycho/MCServer && $(MAKE) -f lib/lua/CMakeFiles/lua.dir/build.make lib/lua/CMakeFiles/lua.dir/src/luac.c.s -.PHONY : src/luac.c.s - src/lundump.o: src/lundump.c.o .PHONY : src/lundump.o @@ -964,12 +916,6 @@ help: @echo "... src/ltm.o" @echo "... src/ltm.i" @echo "... src/ltm.s" - @echo "... src/lua.o" - @echo "... src/lua.i" - @echo "... src/lua.s" - @echo "... src/luac.o" - @echo "... src/luac.i" - @echo "... src/luac.s" @echo "... src/lundump.o" @echo "... src/lundump.i" @echo "... src/lundump.s" diff --git a/src/OSSupport/Queue.h b/src/OSSupport/Queue.h new file mode 100644 index 000000000..4571272b3 --- /dev/null +++ b/src/OSSupport/Queue.h @@ -0,0 +1,31 @@ +#pragma once + +template +class cDeleter +{ + public: + static void Delete(T) {}; +}; + +template> +class cQueue +{ +public: + cQueue(int warnsize); + cQueue(cQueue& queue); + ~cQueue(); + + void EnqueueItem(T item); + bool TryDequeueItem(T& item); + T DequeueItem(); + void BlockTillEmpty(cEvent CancelationEvent); + void Clear(); + int Size(); + +private: + int warnsize; + std::list contents; +}; + +//template classes must be implemented in the header +#include "Queue.inc" diff --git a/src/WorldStorage/WorldStorage.h b/src/WorldStorage/WorldStorage.h index 007d37571..106842a22 100644 --- a/src/WorldStorage/WorldStorage.h +++ b/src/WorldStorage/WorldStorage.h @@ -16,6 +16,7 @@ #include "../ChunkDef.h" #include "../OSSupport/IsThread.h" +#include "../OSSupport/Queue.h" @@ -93,7 +94,7 @@ protected: sChunkLoad(int a_ChunkX, int a_ChunkY, int a_ChunkZ, bool a_Generate) : m_ChunkX(a_ChunkX), m_ChunkY(a_ChunkY), m_ChunkZ(a_ChunkZ), m_Generate(a_Generate) {} } ; - typedef std::list sChunkLoadQueue; + typedef cQueue sChunkLoadQueue; cWorld * m_World; AString m_StorageSchemaName; -- cgit v1.2.3