summaryrefslogtreecommitdiffstats
path: root/libunwind/src/Unwind_AppleExtras.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libunwind/src/Unwind_AppleExtras.cpp')
-rw-r--r--libunwind/src/Unwind_AppleExtras.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/libunwind/src/Unwind_AppleExtras.cpp b/libunwind/src/Unwind_AppleExtras.cpp
index b8baef5fa76..d8301c057f7 100644
--- a/libunwind/src/Unwind_AppleExtras.cpp
+++ b/libunwind/src/Unwind_AppleExtras.cpp
@@ -185,21 +185,29 @@ bool checkKeyMgrRegisteredFDEs(uintptr_t pc, void *&fde) {
#if !defined(FOR_DYLD) && _LIBUNWIND_BUILD_SJLJ_APIS
-#include <System/pthread_machdep.h>
+#ifndef _LIBUNWIND_HAS_NO_THREADS
+ #include <System/pthread_machdep.h>
+#else
+ _Unwind_FunctionContext *fc_ = nullptr;
+#endif
// Accessors to get get/set linked list of frames for sjlj based execeptions.
_LIBUNWIND_HIDDEN
struct _Unwind_FunctionContext *__Unwind_SjLj_GetTopOfFunctionStack() {
+#ifndef _LIBUNWIND_HAS_NO_THREADS
return (struct _Unwind_FunctionContext *)
_pthread_getspecific_direct(__PTK_LIBC_DYLD_Unwind_SjLj_Key);
+#else
+ return fc_;
+#endif
}
_LIBUNWIND_HIDDEN
void __Unwind_SjLj_SetTopOfFunctionStack(struct _Unwind_FunctionContext *fc) {
+#ifndef _LIBUNWIND_HAS_NO_THREADS
_pthread_setspecific_direct(__PTK_LIBC_DYLD_Unwind_SjLj_Key, fc);
+#else
+ fc_ = fc;
+#endif
}
#endif
-
-
-
-
OpenPOWER on IntegriCloud