From 166153198502454a8373e941b80c21ede38ddf3f Mon Sep 17 00:00:00 2001 From: Mikle Kolyada 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 Signed-off-by: Anthony G. Basile Signed-off-by: Mikle Kolyada --- 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