void-packages/srcpkgs/ecl/patches/fix-math_fenv_h.patch
Gonzalo Tornaría 906662e77b ecl: update to 21.2.1.
Also:
- remove fix-libffi-system.patch (not needed anymore)
- clean-up fix-math_fenv_h.patch
  upstream: https://gitlab.com/embeddable-common-lisp/ecl/-/issues/653#note_675299471
- add long long, int64_t and uint64_t in all the cross_config files;
  compilation fails when long long is enabled in host but disabled in target.
- replace the per-arch cross_config files by a single one, which is
  conditional on $XBPS_TARGET_WORDSIZE and $XBPS_TARGET_ENDIAN.
2021-09-15 22:43:57 -03:00

31 lines
892 B
Diff

Source: @pullmoll
Upstream: https://gitlab.com/embeddable-common-lisp/ecl/-/issues/653#note_675299471
Reason: Some architectures do not define all of the FE_.. constants
Example: mips-musl needs this
diff --git a/src/h/impl/math_fenv.h b/src/h/impl/math_fenv.h
index ea13d87b4..2afbb9549 100644
--- a/src/h/impl/math_fenv.h
+++ b/src/h/impl/math_fenv.h
@@ -55,6 +55,21 @@
#ifdef HAVE_FENV_H
# define ECL_WITHOUT_FPE_BEGIN do { fenv_t env; feholdexcept(&env);
# define ECL_WITHOUT_FPE_END fesetenv(&env); } while (0)
+# if !defined(FE_DIVBYZERO)
+# define FE_DIVBYZERO 0
+# endif
+# if !defined(FE_INVALID)
+# define FE_INVALID 0
+# endif
+# if !defined(FE_OVERFLOW)
+# define FE_OVERFLOW 0
+# endif
+# if !defined(FE_UNDERFLOW)
+# define FE_UNDERFLOW 0
+# endif
+# if !defined(FE_INEXACT)
+# define FE_INEXACT 0
+# endif
#else
# define FE_INVALID 1
# define FE_DIVBYZERO 2