Fix warning about math functions, include isnan, isinf, fpclassify.

This commit is contained in:
George Zhao 2018-01-17 19:45:49 +08:00
parent 3632f02564
commit 43833af53c
2 changed files with 17 additions and 0 deletions

View File

@ -288,6 +288,11 @@ int encode_read_from_list(ListReaderState *const state, char *const buf,
: OK);
}
#ifdef __MINGW32__
# undef fpclassify
# define fpclassify __fpclassify
#endif
#define TYPVAL_ENCODE_CONV_STRING(tv, buf, len) \
do { \
const char *const buf_ = (const char *) buf; \

View File

@ -50,6 +50,18 @@
#include "nvim/os/shell.h"
#include "nvim/eval/encode.h"
/*
* Fix warning on mingw32 and mingw64
* make isnan as _isnan
* fpclassify is used by isinf, so redefine it
*/
#ifdef __MINGW32__
# undef fpclassify
# define fpclassify __fpclassify
# undef isnan
# define isnan _isnan
#endif
/*
* Copy "string" into newly allocated memory.
*/