Patch 7.4.1408
Problem:    MS-Windows doesn't have isnan() and isinf().
Solution:   Use _isnan() and _isinf().
Files:      src/eval.c, src/json.c


*** ../vim-7.4.1407/src/eval.c  2016-02-23 21:26:38.770552198 +0100
--- src/eval.c  2016-02-23 21:47:32.765412226 +0100
***************
*** 27,34 ****
  # include <time.h>    /* for time_t */
  #endif
  
! #if defined(FEAT_FLOAT) && defined(HAVE_MATH_H)
! # include <math.h>
  #endif
  
  #define DICT_MAXNEST 100      /* maximum nesting of lists and dicts */
--- 27,40 ----
  # include <time.h>    /* for time_t */
  #endif
  
! #if defined(FEAT_FLOAT)
! # include <float.h>
! # if defined(HAVE_MATH_H)
! #  include <math.h>
! # endif
! # if defined(WIN32) && !defined(isnan)
! #  define isnan(x) _isnan(x)
! # endif
  #endif
  
  #define DICT_MAXNEST 100      /* maximum nesting of lists and dicts */
*** ../vim-7.4.1407/src/json.c  2016-02-23 21:26:38.770552198 +0100
--- src/json.c  2016-02-23 22:03:16.563520874 +0100
***************
*** 17,25 ****
  
  #if defined(FEAT_EVAL) || defined(PROTO)
  
! #if defined(FEAT_FLOAT) && defined(HAVE_MATH_H)
!   /* for isnan() and isinf() */
! # include <math.h>
  #endif
  
  static int json_encode_item(garray_T *gap, typval_T *val, int copyID, int 
options);
--- 17,36 ----
  
  #if defined(FEAT_EVAL) || defined(PROTO)
  
! #if defined(FEAT_FLOAT)
! # include <float.h>
! # if defined(HAVE_MATH_H)
!    /* 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))
! # endif
! # if defined(_MSC_VER) && !defined(INFINITY)
! #  define INFINITY (DBL_MAX+DBL_MAX)
! #  define NAN (INFINITY-INFINITY)
! # endif
  #endif
  
  static int json_encode_item(garray_T *gap, typval_T *val, int copyID, int 
options);
***************
*** 745,751 ****
                if (res != NULL)
                {
                    res->v_type = VAR_FLOAT;
!                   res->vval.v_float = 0.0 / 0.0;
                }
                return OK;
            }
--- 756,762 ----
                if (res != NULL)
                {
                    res->v_type = VAR_FLOAT;
!                   res->vval.v_float = NAN;
                }
                return OK;
            }
***************
*** 755,761 ****
                if (res != NULL)
                {
                    res->v_type = VAR_FLOAT;
!                   res->vval.v_float = 1.0 / 0.0;
                }
                return OK;
            }
--- 766,772 ----
                if (res != NULL)
                {
                    res->v_type = VAR_FLOAT;
!                   res->vval.v_float = INFINITY;
                }
                return OK;
            }
*** ../vim-7.4.1407/src/version.c       2016-02-23 21:26:38.770552198 +0100
--- src/version.c       2016-02-23 22:06:01.249793202 +0100
***************
*** 750,751 ****
--- 750,753 ----
  {   /* Add new patch number below this line */
+ /**/
+     1408,
  /**/

-- 
ARTHUR:   Ni!
BEDEVERE: Nu!
ARTHUR:   No.  Ni!  More like this. "Ni"!
BEDEVERE: Ni, ni, ni!
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
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.

Raspunde prin e-mail lui