mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Replace thread_local with boost equivalent
The new version of clang (Apple LLVM version 6.1.0) as shipped with Xcode 6.3, disabled TLS. According to http://clang.llvm.org/cxx_status.html, in order to support `thread_local`, the C++ runtime library from g++-4.8 or later is needed. For now, we can use the boost `thread_specific_ptr`. This is probably a reasonable solution since 1) it should be portable with old and future versions of (Apple's) clang and 2) requires no additional dependencies.
This commit is contained in:
committed by
Allan Odgaard
parent
23509380cb
commit
172ce9d428
@@ -1,4 +1,5 @@
|
|||||||
#include "info.h"
|
#include "info.h"
|
||||||
|
#include <boost/thread/tss.hpp>
|
||||||
#include <oak/debug.h>
|
#include <oak/debug.h>
|
||||||
|
|
||||||
/* CrashReporter info */
|
/* CrashReporter info */
|
||||||
@@ -58,8 +59,11 @@ namespace
|
|||||||
|
|
||||||
static stack_t& stack ()
|
static stack_t& stack ()
|
||||||
{
|
{
|
||||||
thread_local stack_t stack;
|
static boost::thread_specific_ptr<stack_t> stackPtr;
|
||||||
return stack;
|
if(!stackPtr.get())
|
||||||
|
stackPtr.reset(new stack_t);
|
||||||
|
|
||||||
|
return *stackPtr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
2
target
2
target
@@ -28,6 +28,8 @@ LN_FLAGS += -rpath @executable_path/../Frameworks
|
|||||||
CXX_FLAGS += -I"$capnp_prefix/include"
|
CXX_FLAGS += -I"$capnp_prefix/include"
|
||||||
LN_FLAGS += -L"$capnp_prefix/lib"
|
LN_FLAGS += -L"$capnp_prefix/lib"
|
||||||
|
|
||||||
|
LN_FLAGS += -lboost_thread-mt
|
||||||
|
|
||||||
PRELUDE = Shared/PCH/prelude.*
|
PRELUDE = Shared/PCH/prelude.*
|
||||||
|
|
||||||
TARGETS = vendor/*/target
|
TARGETS = vendor/*/target
|
||||||
|
|||||||
Reference in New Issue
Block a user