aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/strings.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-01-20 22:40:31 +0100
committerJustin M. Keyes <justinkz@gmail.com>2019-01-20 23:51:12 +0100
commitc6a039d087ca2b333d1d3a2604d675e0010f7063 (patch)
tree594c694e2396ed96b804b7106c38db9ebf899a0d /src/nvim/strings.c
parent53c0f0bba50f424683d281a3631aee86cce78368 (diff)
downloadrneovim-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/strings.c')
-rw-r--r--src/nvim/strings.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/nvim/strings.c b/src/nvim/strings.c
index 4921824316..533784767c 100644
--- a/src/nvim/strings.c
+++ b/src/nvim/strings.c
@@ -50,16 +50,7 @@
#include "nvim/os/shell.h"
#include "nvim/eval/encode.h"
-#ifdef __MINGW32__
-# undef fpclassify
-# define fpclassify __fpclassify
-# undef isnan
-# define isnan _isnan
-#endif
-
-/*
- * Copy "string" into newly allocated memory.
- */
+/// Copy "string" into newly allocated memory.
char_u *vim_strsave(const char_u *string)
FUNC_ATTR_NONNULL_RET FUNC_ATTR_MALLOC FUNC_ATTR_NONNULL_ALL
{
@@ -1214,14 +1205,14 @@ int vim_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap,
remove_trailing_zeroes = true;
}
- if (isinf(f)
+ if (xisinf(f)
|| (strchr("fF", fmt_spec) != NULL && abs_f > 1.0e307)) {
xstrlcpy(tmp, infinity_str(f > 0.0, fmt_spec,
force_sign, space_for_positive),
sizeof(tmp));
str_arg_l = strlen(tmp);
zero_padding = 0;
- } else if (isnan(f)) {
+ } else if (xisnan(f)) {
// Not a number: nan or NAN
memmove(tmp, ASCII_ISUPPER(fmt_spec) ? "NAN" : "nan", 4);
str_arg_l = 3;