Skip to content

Commit fefecb0

Browse files
committed
patch 7.4.1440
Problem: Can't build on Windows. Solution: Change #ifdefs. Only define isnan when used.
1 parent f97ddbe commit fefecb0

File tree

4 files changed

+25
-17
lines changed

4 files changed

+25
-17
lines changed

src/eval.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
/*
1111
* eval.c: Expression evaluation.
1212
*/
13+
#define USING_FLOAT_STUFF
1314

1415
#include "vim.h"
1516

src/json.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
*
1313
* Follows this standard: https://tools.ietf.org/html/rfc7159.html
1414
*/
15+
#define USING_FLOAT_STUFF
1516

1617
#include "vim.h"
1718

src/macros.h

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -327,25 +327,29 @@
327327
/* for isnan() and isinf() */
328328
# include <math.h>
329329
# endif
330-
# if defined(WIN32) && !defined(isnan)
331-
# define isnan(x) _isnan(x)
332-
# define isinf(x) (!_finite(x) && !_isnan(x))
333-
# else
334-
# ifndef HAVE_ISNAN
335-
static inline int isnan(double x) { return x != x; }
330+
# ifdef USING_FLOAT_STUFF
331+
# if defined(WIN32)
332+
# ifndef isnan
333+
# define isnan(x) _isnan(x)
334+
# define isinf(x) (!_finite(x) && !_isnan(x))
335+
# endif
336+
# else
337+
# ifndef HAVE_ISNAN
338+
static inline int isnan(double x) { return x != x; }
339+
# endif
340+
# ifndef HAVE_ISINF
341+
static inline int isinf(double x) { return !isnan(x) && isnan(x - x); }
342+
# endif
336343
# endif
337-
# ifndef HAVE_ISINF
338-
static inline int isinf(double x) { return !isnan(x) && isnan(x - x); }
344+
# if !defined(INFINITY)
345+
# if defined(DBL_MAX)
346+
# define INFINITY (DBL_MAX+DBL_MAX)
347+
# else
348+
# define INFINITY (1.0 / 0.0)
349+
# endif
339350
# endif
340-
# endif
341-
# if !defined(INFINITY)
342-
# if defined(DBL_MAX)
343-
# define INFINITY (DBL_MAX+DBL_MAX)
344-
# else
345-
# define INFINITY (1.0 / 0.0)
351+
# if !defined(NAN)
352+
# define NAN (INFINITY-INFINITY)
346353
# endif
347354
# endif
348-
# if !defined(NAN)
349-
# define NAN (INFINITY-INFINITY)
350-
# endif
351355
#endif

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,8 @@ static char *(features[]) =
743743

744744
static int included_patches[] =
745745
{ /* Add new patch number below this line */
746+
/**/
747+
1440,
746748
/**/
747749
1439,
748750
/**/

0 commit comments

Comments
 (0)