lcalc: use libc++-compatible way of extending namespace std (#370545)
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
diff --git a/src/libLfunction/Lcomplex.h b/src/libLfunction/Lcomplex.h
|
||||
index 363bbf4..ffecd70 100644
|
||||
--- a/src/libLfunction/Lcomplex.h
|
||||
+++ b/src/libLfunction/Lcomplex.h
|
||||
@@ -56,8 +56,11 @@
|
||||
#include <cmath>
|
||||
#include <sstream>
|
||||
|
||||
-namespace std
|
||||
-{
|
||||
+#ifdef _LIBCPP_VERSION
|
||||
+_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
+#else
|
||||
+namespace std {
|
||||
+#endif
|
||||
// Forward declarations
|
||||
template<typename _Tp> class complex;
|
||||
template<> class complex<float>;
|
||||
@@ -1193,6 +1196,10 @@ namespace std
|
||||
inline
|
||||
complex<long double>::complex(const complex<double>& __z)
|
||||
: _M_value(_ComplexT(__z._M_value)) { }
|
||||
-} // namespace std
|
||||
+#ifdef _LIBCPP_VERSION
|
||||
+_LIBCPP_END_NAMESPACE_STD
|
||||
+#else
|
||||
+}
|
||||
+#endif
|
||||
|
||||
#endif /* _CPP_COMPLEX */
|
||||
@@ -19,13 +19,9 @@ stdenv.mkDerivation rec {
|
||||
hash = "sha256-RxWZ7T0I9zV7jUVnL6jV/PxEoU32KY7Q1UsOL5Lonuc=";
|
||||
};
|
||||
|
||||
# workaround for vendored GCC 3.5 <complex>
|
||||
# workaround for vendored GCC <complex> on libc++
|
||||
# https://gitlab.com/sagemath/lcalc/-/issues/16
|
||||
env.NIX_CFLAGS_COMPILE = toString [
|
||||
"-D_GLIBCXX_COMPLEX"
|
||||
"-D_LIBCPP_COMPLEX"
|
||||
"-D_LIBCPP___FWD_COMPLEX_H"
|
||||
];
|
||||
patches = [ ./libcxx-compat.patch ];
|
||||
|
||||
nativeBuildInputs = [
|
||||
autoreconfHook
|
||||
|
||||
Reference in New Issue
Block a user