Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions pkgs/by-name/lc/lcalc/libcxx-compat.patch
Original file line number Diff line number Diff line change
@@ -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 */
8 changes: 2 additions & 6 deletions pkgs/by-name/lc/lcalc/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading