diff options
author | Howard Hinnant <hhinnant@apple.com> | 2012-02-23 15:32:07 +0000 |
---|---|---|
committer | Howard Hinnant <hhinnant@apple.com> | 2012-02-23 15:32:07 +0000 |
commit | fdac5f9274eb4854820f45e7991099706a00504b (patch) | |
tree | 5f6cbe6ca2485a8e120577926970ddc5f8c5d6bf /src/cxa_handlers.cpp | |
parent | 74ecc63c3f0f72848cf0deb509e194a29487d83b (diff) |
I had originally made the handler function pointers a static internal detail, not accessible to the outside world. I did this because they must be accessed in a thread-safe manner, and the library provides thread-safe getters and setters for these. However I am at least temporarily making them public and giving them the Apple-extension names. In the future these may disappear again, and I think that would probably be a good idea.
git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@151256 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'src/cxa_handlers.cpp')
-rw-r--r-- | src/cxa_handlers.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/cxa_handlers.cpp b/src/cxa_handlers.cpp index be43181..e114de3 100644 --- a/src/cxa_handlers.cpp +++ b/src/cxa_handlers.cpp @@ -85,22 +85,22 @@ static void default_unexpected_handler() terminate(); } -static terminate_handler __terminate_handler = default_terminate_handler; -static unexpected_handler __unexpected_handler = default_unexpected_handler; -static new_handler __new_handler = 0; +terminate_handler __cxa_terminate_handler = default_terminate_handler; +unexpected_handler __cxa_unexpected_handler = default_unexpected_handler; +new_handler __cxa_new_handler = 0; unexpected_handler set_unexpected(unexpected_handler func) _NOEXCEPT { if (func == 0) func = default_unexpected_handler; - return __sync_lock_test_and_set(&__unexpected_handler, func); + return __sync_lock_test_and_set(&__cxa_unexpected_handler, func); } unexpected_handler get_unexpected() _NOEXCEPT { - return __sync_fetch_and_add(&__unexpected_handler, (unexpected_handler)0); + return __sync_fetch_and_add(&__cxa_unexpected_handler, (unexpected_handler)0); } __attribute__((visibility("hidden"), noreturn)) @@ -124,13 +124,13 @@ set_terminate(terminate_handler func) _NOEXCEPT { if (func == 0) func = default_terminate_handler; - return __sync_lock_test_and_set(&__terminate_handler, func); + return __sync_lock_test_and_set(&__cxa_terminate_handler, func); } terminate_handler get_terminate() _NOEXCEPT { - return __sync_fetch_and_add(&__terminate_handler, (terminate_handler)0); + return __sync_fetch_and_add(&__cxa_terminate_handler, (terminate_handler)0); } __attribute__((visibility("hidden"), noreturn)) @@ -184,13 +184,13 @@ terminate() _NOEXCEPT new_handler set_new_handler(new_handler handler) _NOEXCEPT { - return __sync_lock_test_and_set(&__new_handler, handler); + return __sync_lock_test_and_set(&__cxa_new_handler, handler); } new_handler get_new_handler() _NOEXCEPT { - return __sync_fetch_and_add(&__new_handler, (new_handler)0); + return __sync_fetch_and_add(&__cxa_new_handler, (new_handler)0); } } // std |