summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authordearblue <[email protected]>2021-11-28 17:28:44 +0900
committerdearblue <[email protected]>2021-11-28 17:28:44 +0900
commitf81bc3de387e3ff229433a2db8632b33bd62e94f (patch)
treef6f2569723f04bfa0d3d55d182dc03eb55b6c3fc
parente4d691778676f8cb284c91b8ca72b2dff41e2560 (diff)
downloadmruby-f81bc3de387e3ff229433a2db8632b33bd62e94f.tar.gz
mruby-f81bc3de387e3ff229433a2db8632b33bd62e94f.zip
Fixed compile error for `mrbgems/mruby-cmath` with `clang++`
If the preprocessor check part is only `__clang__`, CI's such as `Ubuntu-2004-clang` will fail to compile. This is why we limited the addition to FreeBSD and OpenBSD, which have `clang++` in their base systems. DragonFly BSD and NetBSD have GCC built into their base systems, so nothing is changed.
-rw-r--r--mrbgems/mruby-cmath/src/cmath.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mrbgems/mruby-cmath/src/cmath.c b/mrbgems/mruby-cmath/src/cmath.c
index 8b0c4d04a..de59adf96 100644
--- a/mrbgems/mruby-cmath/src/cmath.c
+++ b/mrbgems/mruby-cmath/src/cmath.c
@@ -92,7 +92,7 @@ CXDIVc(mrb_complex a, mrb_complex b)
#else
-#if defined(__cplusplus) && defined(__APPLE__)
+#if defined(__cplusplus) && (defined(__APPLE__) || (defined(__clang__) && (defined(__FreeBSD__) || defined(__OpenBSD__))))
#ifdef MRB_USE_FLOAT32
typedef std::complex<float> mrb_complex;