To: vim_dev@googlegroups.com Subject: Patch 7.4.1408 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ 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 /* for time_t */ #endif ! #if defined(FEAT_FLOAT) && defined(HAVE_MATH_H) ! # include #endif #define DICT_MAXNEST 100 /* maximum nesting of lists and dicts */ --- 27,40 ---- # include /* for time_t */ #endif ! #if defined(FEAT_FLOAT) ! # include ! # if defined(HAVE_MATH_H) ! # include ! # 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 #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 ! # if defined(HAVE_MATH_H) ! /* for isnan() and isinf() */ ! # include ! # 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 -- Bram@Moolenaar.net -- 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 ///