blob: 6f28f6f3a478f095e03c85219c9cacae33ff503f [file] [log] [blame]
From 27956d4c5fb615098231cebfb8eef11057639d3c Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Date: Sun, 8 Dec 2019 18:14:38 +0100
Subject: [PATCH] src/tbbmalloc/proxy.cpp: __GLIBC_PREREQ is not defined on
musl
Do not call __GLIBC_PREREQ if it is not defined otherwise build will
fail on musl
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Upstream-Status: Submitted [https://github.com/oneapi-src/oneTBB/pull/203]
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
---
src/tbbmalloc/proxy.cpp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/tbbmalloc/proxy.cpp b/src/tbbmalloc/proxy.cpp
index d96ae7a0..709ae839 100644
--- a/src/tbbmalloc/proxy.cpp
+++ b/src/tbbmalloc/proxy.cpp
@@ -24,7 +24,8 @@
// of aligned_alloc as required by new C++ standard, this makes it hard to
// redefine aligned_alloc here. However, running on systems with new libc
// version, it still needs it to be redefined, thus tricking system headers
-#if defined(__GLIBC_PREREQ) && !__GLIBC_PREREQ(2, 16) && _GLIBCXX_HAVE_ALIGNED_ALLOC
+#if defined(__GLIBC_PREREQ)
+#if !__GLIBC_PREREQ(2, 16) && _GLIBCXX_HAVE_ALIGNED_ALLOC
// tell <cstdlib> that there is no aligned_alloc
#undef _GLIBCXX_HAVE_ALIGNED_ALLOC
// trick <stdlib.h> to define another symbol instead
@@ -32,7 +33,8 @@
// Fix the state and undefine the trick
#include <cstdlib>
#undef aligned_alloc
-#endif // defined(__GLIBC_PREREQ)&&!__GLIBC_PREREQ(2, 16)&&_GLIBCXX_HAVE_ALIGNED_ALLOC
+#endif // defined(__GLIBC_PREREQ)
+#endif // !__GLIBC_PREREQ(2, 16)&&_GLIBCXX_HAVE_ALIGNED_ALLOC
#endif // __linux__ && !__ANDROID__
#include "proxy.h"