From c6a039d087ca2b333d1d3a2604d675e0010f7063 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 20 Jan 2019 22:40:31 +0100 Subject: 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 --- src/nvim/eval/encode.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/nvim/eval/encode.c') diff --git a/src/nvim/eval/encode.c b/src/nvim/eval/encode.c index 64658b52d9..cf9ecd8d56 100644 --- a/src/nvim/eval/encode.c +++ b/src/nvim/eval/encode.c @@ -28,11 +28,6 @@ #include "nvim/lib/kvec.h" #include "nvim/eval/typval_encode.h" -#ifdef __MINGW32__ -# undef fpclassify -# define fpclassify __fpclassify -#endif - #define ga_concat(a, b) ga_concat(a, (char_u *)b) #define utf_ptr2char(b) utf_ptr2char((char_u *)b) #define utf_ptr2len(b) ((size_t)utf_ptr2len((char_u *)b)) @@ -327,7 +322,7 @@ int encode_read_from_list(ListReaderState *const state, char *const buf, #define TYPVAL_ENCODE_CONV_FLOAT(tv, flt) \ do { \ const float_T flt_ = (flt); \ - switch (fpclassify(flt_)) { \ + switch (xfpclassify(flt_)) { \ case FP_NAN: { \ ga_concat(gap, (char_u *) "str2float('nan')"); \ break; \ @@ -531,7 +526,7 @@ int encode_read_from_list(ListReaderState *const state, char *const buf, #define TYPVAL_ENCODE_CONV_FLOAT(tv, flt) \ do { \ const float_T flt_ = (flt); \ - switch (fpclassify(flt_)) { \ + switch (xfpclassify(flt_)) { \ case FP_NAN: { \ EMSG(_("E474: Unable to represent NaN value in JSON")); \ return FAIL; \ -- cgit