summaryrefslogtreecommitdiff
blob: 015bba941e3bef8bb57706ecfa58d38892b1c98a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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