Hi,
2016/2/28 Sun 4:47:51 UTC+9 tux. wrote:
> Bram Moolenaar schrob am Samstag, 27. Februar 2016 um 20:14 Zeit:
>
> > Adjust #ifdefs. Detect isnan() and isinf() functions with configure.
> > Use a replacement when missing. (Kazunobu Kuriyama)
>
> Sadly, that breaks on Windows (MSVC2010) again, probably related to
> Perl:
>
> > if_perl.c
> > c:\perl64\perl\lib\core\win32.h(250) : warning C4005: 'isnan':
> > Makro-Neudefinition
>
> This leads to:
>
> > if_ruby.c
> > (...)\vim\src\macros.h(338) : error C2059: Syntaxfehler: '!'
Attached patch should fix them.
Regards,
Ken Takata
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.
# HG changeset patch
# Parent bc3f760554b391af3f1e2c3d431dbb54645105dc
diff --git a/src/if_perl.xs b/src/if_perl.xs
--- a/src/if_perl.xs
+++ b/src/if_perl.xs
@@ -47,6 +47,7 @@
/* Work around for using MSVC and ActivePerl 5.18. */
#ifdef _MSC_VER
# define __inline__ __inline
+# undef isnan
#endif
#ifdef __GNUC__
diff --git a/src/macros.h b/src/macros.h
--- a/src/macros.h
+++ b/src/macros.h
@@ -327,9 +327,13 @@
/* for isnan() and isinf() */
# include <math.h>
# endif
-# if defined(WIN32) && !defined(isnan)
-# define isnan(x) _isnan(x)
-# define isinf(x) (!_finite(x) && !_isnan(x))
+# ifdef WIN32
+# ifndef isnan
+# define isnan(x) _isnan(x)
+# endif
+# ifndef isinf
+# define isinf(x) (!_finite(x) && !_isnan(x))
+# endif
# else
# ifndef HAVE_ISNAN
static inline int isnan(double x) { return x != x; }