diff options
author | David Robillard <d@drobilla.net> | 2016-10-01 19:50:38 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2016-10-01 19:50:38 -0400 |
commit | c73c877f8bd09e0d5a6663ea5ba32a54465f5376 (patch) | |
tree | 185f2da0e58e1c2ab75c4d9db851cf6fc7ca90ee | |
parent | 604015aa65de7d84f177b53e578a8c9852d7893f (diff) | |
download | ingen-c73c877f8bd09e0d5a6663ea5ba32a54465f5376.tar.gz ingen-c73c877f8bd09e0d5a6663ea5ba32a54465f5376.tar.bz2 ingen-c73c877f8bd09e0d5a6663ea5ba32a54465f5376.zip |
Fix OSX build
-rw-r--r-- | ingen/SocketWriter.hpp | 2 | ||||
-rw-r--r-- | ingen/StreamWriter.hpp | 2 | ||||
-rw-r--r-- | src/server/Engine.cpp | 4 | ||||
-rw-r--r-- | src/server/PreProcessor.cpp | 2 | ||||
-rw-r--r-- | src/server/ThreadManager.hpp | 6 | ||||
-rw-r--r-- | src/server/events/Mark.hpp | 2 | ||||
-rw-r--r-- | src/server/util.hpp | 8 | ||||
-rw-r--r-- | wscript | 9 |
8 files changed, 27 insertions, 8 deletions
diff --git a/ingen/SocketWriter.hpp b/ingen/SocketWriter.hpp index 871a63f5..e8b522f6 100644 --- a/ingen/SocketWriter.hpp +++ b/ingen/SocketWriter.hpp @@ -34,7 +34,7 @@ public: const Raul::URI& uri, SPtr<Raul::Socket> sock); - size_t text_sink(const void* buf, size_t len) override; + size_t text_sink(const void* buf, size_t len); /** Override of bundle_end to terminate bundles in the stream. */ void bundle_end(); diff --git a/ingen/StreamWriter.hpp b/ingen/StreamWriter.hpp index 7a62382c..cefd51cc 100644 --- a/ingen/StreamWriter.hpp +++ b/ingen/StreamWriter.hpp @@ -35,7 +35,7 @@ public: FILE* stream, ColorContext::Color color); - size_t text_sink(const void* buf, size_t len) override; + size_t text_sink(const void* buf, size_t len); protected: FILE* _stream; diff --git a/src/server/Engine.cpp b/src/server/Engine.cpp index 097b38fc..259dbffd 100644 --- a/src/server/Engine.cpp +++ b/src/server/Engine.cpp @@ -61,8 +61,8 @@ using namespace std; namespace Ingen { namespace Server { -thread_local unsigned ThreadManager::flags(0); -bool ThreadManager::single_threaded(true); +INGEN_THREAD_LOCAL unsigned ThreadManager::flags(0); +bool ThreadManager::single_threaded(true); Engine::Engine(Ingen::World* world) : _world(world) diff --git a/src/server/PreProcessor.cpp b/src/server/PreProcessor.cpp index 2ea4ac30..f0008afc 100644 --- a/src/server/PreProcessor.cpp +++ b/src/server/PreProcessor.cpp @@ -89,7 +89,7 @@ PreProcessor::process(RunContext& context, PostProcessor& dest, size_t limit) Event* ev = head; Event* last = ev; while (ev && ev->is_prepared()) { - switch (_block_state) { + switch (_block_state.load()) { case BlockState::UNBLOCKED: break; case BlockState::PRE_BLOCKED: diff --git a/src/server/ThreadManager.hpp b/src/server/ThreadManager.hpp index bec7d614..3bcedf30 100644 --- a/src/server/ThreadManager.hpp +++ b/src/server/ThreadManager.hpp @@ -21,6 +21,8 @@ #include "ingen/ingen.h" +#include "util.hpp" + namespace Ingen { namespace Server { @@ -56,8 +58,8 @@ public: /** Set to true during initialisation so ensure_thread doesn't fail. * Defined in Engine.cpp */ - static bool single_threaded; - static thread_local unsigned flags; + static bool single_threaded; + static INGEN_THREAD_LOCAL unsigned flags; }; } // namespace Server diff --git a/src/server/events/Mark.hpp b/src/server/events/Mark.hpp index a68e3b3b..d2db0834 100644 --- a/src/server/events/Mark.hpp +++ b/src/server/events/Mark.hpp @@ -48,7 +48,7 @@ public: void execute(RunContext& context); void post_process(); - Execution get_execution() const override; + Execution get_execution() const; private: Type _type; diff --git a/src/server/util.hpp b/src/server/util.hpp index d6377a9e..7d30cc8f 100644 --- a/src/server/util.hpp +++ b/src/server/util.hpp @@ -35,6 +35,14 @@ # define REALTIME #endif +#if defined(INGEN_HAVE_THREAD_LOCAL) +# define INGEN_THREAD_LOCAL thread_local +#elif defined(INGEN_HAVE_THREAD_BUILTIN) +# define INGEN_THREAD_LOCAL __thread +#else +# define INGEN_THREAD_LOCAL +#endif + namespace Ingen { namespace Server { @@ -60,6 +60,15 @@ def configure(conf): conf.check_cxx(header_name='boost/shared_ptr.hpp') conf.check_cxx(header_name='boost/utility.hpp') conf.check_cxx(header_name='boost/weak_ptr.hpp') + conf.check_cxx(msg='Checking for thread_local keyword', + mandatory=False, + fragment='thread_local int i = 0; int main() {}', + define_name='INGEN_HAVE_THREAD_LOCAL') + if not conf.is_defined('INGEN_HAVE_THREAD_LOCAL'): + conf.check_cxx(msg='Checking for __thread keyword', + mandatory=False, + fragment='__thread int i = 0; int main() {}', + define_name='INGEN_HAVE_THREAD_BUILTIN') autowaf.check_pkg(conf, 'lv2', uselib_store='LV2', atleast_version='1.14.0', mandatory=True) |