From 417e6467224ec697da5cc0f4425ce51f2ef4138e Mon Sep 17 00:00:00 2001 From: Alexander Richardson Date: Wed, 2 Sep 2020 00:22:09 +0100 Subject: [PATCH] Fix -Werror,-Wmacro-redefined in limits.h Those macros are also defined by the compiler-provided float.h which will be included later on (at least in the FreeBSD buildworld case) and triggers these -Werror warnings. Including first and only defining the macros when DBL_DIG/FLT_DIG is missing fixes this problem. Reviewed-by: Ryan Moeller Reviewed-by: Brian Behlendorf Signed-off-by: Alex Richardson Closes #10864 --- lib/libspl/include/limits.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/libspl/include/limits.h b/lib/libspl/include/limits.h index 1a42cfec4..5d996eb84 100644 --- a/lib/libspl/include/limits.h +++ b/lib/libspl/include/limits.h @@ -25,16 +25,21 @@ */ #include_next +#include #ifndef _LIBSPL_LIMITS_H #define _LIBSPL_LIMITS_H +#ifndef DBL_DIG #define DBL_DIG 15 #define DBL_MAX 1.7976931348623157081452E+308 #define DBL_MIN 2.2250738585072013830903E-308 +#endif +#ifndef FLT_DIG #define FLT_DIG 6 #define FLT_MAX 3.4028234663852885981170E+38F #define FLT_MIN 1.1754943508222875079688E-38F +#endif #endif /* _LIBSPL_LIMITS_H */