-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #124 from owent/dev
Update otel-cpp
- Loading branch information
Showing
4 changed files
with
185 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
diff --git a/include/mimalloc/atomic.h b/include/mimalloc/atomic.h | ||
index d5333dd..ae31bf3 100644 | ||
--- a/include/mimalloc/atomic.h | ||
+++ b/include/mimalloc/atomic.h | ||
@@ -30,6 +30,9 @@ terms of the MIT license. A copy of the license can be found in the file | ||
#else | ||
#define MI_ATOMIC_VAR_INIT(x) ATOMIC_VAR_INIT(x) | ||
#endif | ||
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L | ||
+#include <stdatomic.h> | ||
+#endif | ||
#elif defined(_MSC_VER) | ||
// Use MSVC C wrapper for C11 atomics | ||
#define _Atomic(tp) tp | ||
diff --git a/src/alloc.c b/src/alloc.c | ||
index 86aaae7..c95a8a3 100644 | ||
--- a/src/alloc.c | ||
+++ b/src/alloc.c | ||
@@ -439,10 +439,10 @@ but we call `exit` instead (i.e. not returning). | ||
#ifdef __cplusplus | ||
#include <new> | ||
static bool mi_try_new_handler(bool nothrow) { | ||
- #if defined(_MSC_VER) || (__cplusplus >= 201103L) | ||
+ #if (defined(_MSC_VER) || (__cplusplus >= 201103L)) && !(defined(__GNUC__) && __GNUC__ < 5 && !defined(__clang__)) | ||
std::new_handler h = std::get_new_handler(); | ||
#else | ||
- std::new_handler h = std::set_new_handler(); | ||
+ std::new_handler h = std::set_new_handler(nullptr); | ||
std::set_new_handler(h); | ||
#endif | ||
if (h==NULL) { | ||
diff --git a/src/prim/unix/prim.c b/src/prim/unix/prim.c | ||
index dd665d3..d413ad0 100644 | ||
--- a/src/prim/unix/prim.c | ||
+++ b/src/prim/unix/prim.c | ||
@@ -700,7 +700,12 @@ void _mi_prim_out_stderr( const char* msg ) { | ||
#if !defined(MI_USE_ENVIRON) || (MI_USE_ENVIRON!=0) | ||
// On Posix systemsr use `environ` to access environment variables | ||
// even before the C runtime is initialized. | ||
-#if defined(__APPLE__) && defined(__has_include) && __has_include(<crt_externs.h>) | ||
+#if defined(__APPLE__) && defined(__has_include) | ||
+# if __has_include(<crt_externs.h>) | ||
+# define MI_HAVE_CRT_EXTERNS | ||
+# endif | ||
+#endif | ||
+#if defined(MI_HAVE_CRT_EXTERNS) | ||
#include <crt_externs.h> | ||
static char** mi_get_environ(void) { | ||
return (*_NSGetEnviron()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters