pkgsrc/math/mpcomplex/patches/patch-src_get.c
marino 2843cc48af math/mpcomplex: Update from version 0.9 to 1.0
Changes since version 0.9:
  - First release as a GNU package
  - License change: LGPLv3+ for code, GFDLv1.3+ (with no invariant sections)
    for documentation
  - 100% of all lines are covered by tests
  - Functions renamed:
    mpc_mul_2exp to mpc_mul_2ui, mpc_div_2exp to mpc_div_2ui
  - 0^0, which returned (NaN,NaN) previously, now returns (1,+0)
  - Removed compatibility with K&R compilers, untestable due to lack of
    such compilers
  - New functions: mpc_log10, mpc_mul_2si, mpc_div_2si
  - Speed-ups:
    - mpc_fma
  - Bug fixes:
    - mpc_div and mpc_norm now return a value indicating the effective
      rounding direction, as the other functions
    - mpc_mul, mpc_sqr and mpc_norm now return correct results even if there
      are over- or underflows during the computation
    - mpc_asin, mpc_proj, mpc_sqr: Wrong result when input variable has
      infinite part and equals output variable is corrected
    - mpc_fr_sub: Wrong return value for imaginary part is corrected
2012-08-05 18:24:56 +00:00

20 lines
564 B
C

$NetBSD: patch-src_get.c,v 1.2 2012/08/05 18:24:56 marino Exp $
Work around bug in SunOS complex.h to make this build with Sun's gcc
--- src/get_x.c.orig 2011-11-04 18:20:19.000000000 +0000
+++ src/get_x.c
@@ -35,6 +35,13 @@ along with this program. If not, see htt
#include "mpc-impl.h"
#ifdef HAVE_COMPLEX_H
+
+#if defined(__sun) && defined(__GNUC__) && defined(_Imaginary_I)
+#undef I
+#define I (__extension__ 1.0iF)
+
+#endif
+
double _Complex
mpc_get_dc (mpc_srcptr op, mpc_rnd_t rnd) {
return I * mpfr_get_d (mpc_imagref (op), MPC_RND_IM (rnd))