diff options
author | Howard Hinnant <hhinnant@apple.com> | 2012-02-23 19:32:07 +0400 |
---|---|---|
committer | Howard Hinnant <hhinnant@apple.com> | 2012-02-23 19:32:07 +0400 |
commit | 49f28b5a472e6018a40725db9abac3803d9a5883 (patch) | |
tree | 3966b275842f09b7a01b850c3146ded381b3e1bf /libcxxabi/src/cxa_handlers.cpp | |
parent | 91c6b6a9331a7a492e1c316c6b8f17760ce4607c (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.
llvm-svn: 151256
Diffstat (limited to 'libcxxabi/src/cxa_handlers.cpp')
-rw-r--r-- | libcxxabi/src/cxa_handlers.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/libcxxabi/src/cxa_handlers.cpp b/libcxxabi/src/cxa_handlers.cpp index be43181c9e7f..e114de3c3225 100644 --- a/libcxxabi/src/cxa_handlers.cpp +++ b/libcxxabi/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 |