summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2016-10-01 19:50:38 -0400
committerDavid Robillard <d@drobilla.net>2016-10-01 19:50:38 -0400
commitc73c877f8bd09e0d5a6663ea5ba32a54465f5376 (patch)
tree185f2da0e58e1c2ab75c4d9db851cf6fc7ca90ee
parent604015aa65de7d84f177b53e578a8c9852d7893f (diff)
downloadingen-c73c877f8bd09e0d5a6663ea5ba32a54465f5376.tar.gz
ingen-c73c877f8bd09e0d5a6663ea5ba32a54465f5376.tar.bz2
ingen-c73c877f8bd09e0d5a6663ea5ba32a54465f5376.zip
Fix OSX build
-rw-r--r--ingen/SocketWriter.hpp2
-rw-r--r--ingen/StreamWriter.hpp2
-rw-r--r--src/server/Engine.cpp4
-rw-r--r--src/server/PreProcessor.cpp2
-rw-r--r--src/server/ThreadManager.hpp6
-rw-r--r--src/server/events/Mark.hpp2
-rw-r--r--src/server/util.hpp8
-rw-r--r--wscript9
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 {
diff --git a/wscript b/wscript
index 86d4548b..daf859e4 100644
--- a/wscript
+++ b/wscript
@@ -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)