summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'utils-pmx-pmx-src-libf2c-f2c.h-remove-unnecesary-mac.patch')
-rw-r--r--utils-pmx-pmx-src-libf2c-f2c.h-remove-unnecesary-mac.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/utils-pmx-pmx-src-libf2c-f2c.h-remove-unnecesary-mac.patch b/utils-pmx-pmx-src-libf2c-f2c.h-remove-unnecesary-mac.patch
new file mode 100644
index 0000000..015bba9
--- /dev/null
+++ b/utils-pmx-pmx-src-libf2c-f2c.h-remove-unnecesary-mac.patch
@@ -0,0 +1,40 @@
+From 166153198502454a8373e941b80c21ede38ddf3f Mon Sep 17 00:00:00 2001
+From: Mikle Kolyada <zlogene@gentoo.org>
+Date: Sun, 2 Jun 2019 14:38:31 +0300
+Subject: [PATCH 5/6] utils/pmx/pmx-src/libf2c/f2c.h: remove unnecesary macro
+ for abs()
+
+On POSIX systems, abs() is a function provided by your C Standard library,
+so we don't need to define it as a macro. It is dangerous to do so because
+if f2c.h is included before stdlib.h, then then macro breaks the function
+prototype.
+
+See
+
+https://bugs.gentoo.org/show_bug.cgi?id=510770
+
+Signed-off-by: Felix Janda <felix.janda@posteo.de>
+Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
+Signed-off-by: Mikle Kolyada <zlogene@gentoo.org>
+---
+ utils/pmx/pmx-src/libf2c/f2c.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/utils/pmx/pmx-src/libf2c/f2c.h b/utils/pmx/pmx-src/libf2c/f2c.h
+index a8d13f6b..22c439c6 100644
+--- a/utils/pmx/pmx-src/libf2c/f2c.h
++++ b/utils/pmx/pmx-src/libf2c/f2c.h
+@@ -162,8 +162,8 @@ struct Namelist {
+ };
+ typedef struct Namelist Namelist;
+
+-#define abs(x) ((x) >= 0 ? (x) : -(x))
+-#define dabs(x) (doublereal)abs(x)
++extern int abs(int x);
++#define dabs(x) ((doublereal)((x) >= 0 ? (x) : -(x)))
+ #undef min
+ #undef max
+ #define min(a,b) ((a) <= (b) ? (a) : (b))
+--
+2.21.0
+