diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-01-20 22:40:31 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-01-20 23:51:12 +0100 |
commit | c6a039d087ca2b333d1d3a2604d675e0010f7063 (patch) | |
tree | 594c694e2396ed96b804b7106c38db9ebf899a0d /src/nvim/macros.h | |
parent | 53c0f0bba50f424683d281a3631aee86cce78368 (diff) | |
download | rneovim-c6a039d087ca2b333d1d3a2604d675e0010f7063.tar.gz rneovim-c6a039d087ca2b333d1d3a2604d675e0010f7063.tar.bz2 rneovim-c6a039d087ca2b333d1d3a2604d675e0010f7063.zip |
build: Fix -Wconversion warnings for fpclassify et al
closes #8274
- Instead of #undef and re-#define, define "xfoo" wrappers to avoid
include-order sensitivity.
- The warnings are bogus, caused by bad interaction between glibc and
clang 6+.
- https://bugs.llvm.org/show_bug.cgi?id=35268
- https://bugs.llvm.org/show_bug.cgi?id=39738
- https://bugzilla.redhat.com/show_bug.cgi?id=1472437
Diffstat (limited to 'src/nvim/macros.h')
-rw-r--r-- | src/nvim/macros.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/nvim/macros.h b/src/nvim/macros.h index d447bff765..1d47520d8a 100644 --- a/src/nvim/macros.h +++ b/src/nvim/macros.h @@ -1,6 +1,10 @@ #ifndef NVIM_MACROS_H #define NVIM_MACROS_H +#include <math.h> + +#include "auto/config.h" + // EXTERN is only defined in main.c. That's where global variables are // actually defined and initialized. #ifndef EXTERN @@ -19,6 +23,23 @@ # define MAX(X, Y) ((X) > (Y) ? (X) : (Y)) #endif +#if defined(__clang__) && __clang__ == 1 && __clang_major__ >= 6 \ + && defined(HAVE___FPCLASSIFY) +// Workaround glibc + Clang 6+ bug. #8274 +// https://bugzilla.redhat.com/show_bug.cgi?id=1472437 +# define xfpclassify __fpclassify +# define xisnan __isnan +# define xisinf __isinf +#elif defined(__MINGW32__) +// Workaround mingw warning. #7863 +# define xfpclassify __fpclassify +# define xisnan _isnan +#else +# define xfpclassify fpclassify +# define xisnan isnan +# define xisinf isinf +#endif + /// String with length /// /// For use in functions which accept (char *s, size_t len) pair in arguments. |