aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAlexander Richardson <[email protected]>2020-09-02 00:22:09 +0100
committerGitHub <[email protected]>2020-09-01 16:22:09 -0700
commit417e6467224ec697da5cc0f4425ce51f2ef4138e (patch)
tree13c13f7b0851c73b8f6f93eb3838eed33d571a85 /lib
parent964791acdcc99182d8a36e7f65ae15bf988886be (diff)
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 <float.h> first and only defining the macros when DBL_DIG/FLT_DIG is missing fixes this problem. Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Alex Richardson <[email protected]> Closes #10864
Diffstat (limited to 'lib')
-rw-r--r--lib/libspl/include/limits.h5
1 files changed, 5 insertions, 0 deletions
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 <limits.h>
+#include <float.h>
#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 */