From 4e80dcfdb60a51fba523e0774ff91d29e3e419f6 Mon Sep 17 00:00:00 2001 From: hans Date: Thu, 13 Oct 2011 13:22:46 +0000 Subject: Work around a bug in SunOS complex.h to make this build with Suns gcc. --- math/mpcomplex/distinfo | 3 ++- math/mpcomplex/patches/patch-src_get.c | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 math/mpcomplex/patches/patch-src_get.c (limited to 'math') diff --git a/math/mpcomplex/distinfo b/math/mpcomplex/distinfo index 2e706a93ea3..55bfda5f284 100644 --- a/math/mpcomplex/distinfo +++ b/math/mpcomplex/distinfo @@ -1,5 +1,6 @@ -$NetBSD: distinfo,v 1.2 2011/03/09 18:59:46 asau Exp $ +$NetBSD: distinfo,v 1.3 2011/10/13 13:22:46 hans Exp $ SHA1 (mpc-0.9.tar.gz) = 229722d553030734d49731844abfef7617b64f1a RMD160 (mpc-0.9.tar.gz) = 63d5fb8ab2725839e7565716c4d20187b606e2c8 Size (mpc-0.9.tar.gz) = 565953 bytes +SHA1 (patch-src_get.c) = 439d4bb0dc8714b111787d21f8f14b8da5588fcd diff --git a/math/mpcomplex/patches/patch-src_get.c b/math/mpcomplex/patches/patch-src_get.c new file mode 100644 index 00000000000..2e80dabd669 --- /dev/null +++ b/math/mpcomplex/patches/patch-src_get.c @@ -0,0 +1,18 @@ +$NetBSD: patch-src_get.c,v 1.1 2011/10/13 13:22:46 hans Exp $ + +--- src/get.c.orig 2011-01-26 09:47:17.000000000 +0100 ++++ src/get.c 2011-10-13 01:09:15.618498023 +0200 +@@ -28,6 +28,13 @@ MA 02111-1307, USA. */ + #include "mpc-impl.h" + + #if defined _MPC_H_HAVE_COMPLEX ++ ++#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)) -- cgit v1.2.3