On Friday, February 26, 2016 at 11:04:56 AM UTC-6, Bram Moolenaar wrote:
> Ozaki Kiichi wrote:
>
> > Some vim codes use C99 features;
>
> We aim at ANSI C, but some things may be optional.
>
> > * json.c: isinf(), NAN, INFINITY
>
> AFAIK isinf() is ANSI C.
>
> It appears INFINITY was first officially standardized in C99, but it
> existed much longer before that. Not sure what else to use when
> INFINITY is not available.
>
> NAN is not even in C99, it appears. Again, not sure what to do if it's
> not available.
>
Both of these just bit me, trying to compile with a really old compiler I'm
stuck with on a Solaris server at work (gcc 2.95.2).
I got around it by removing the Windows checks from the re-definitions (see
patch). Why do we limit this to Windows anyway?
--
--
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.
*** src/json.c.orig Fri Feb 26 12:45:33 2016
--- src/json.c Fri Feb 26 12:45:43 2016
***************
*** 23,33 ****
/* 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
--- 23,33 ----
/* for isnan() and isinf() */
# include <math.h>
# endif
! # if !defined(isnan)
# define isnan(x) _isnan(x)
# define isinf(x) (!_finite(x) && !_isnan(x))
# endif
! # if !defined(INFINITY)
# define INFINITY (DBL_MAX+DBL_MAX)
# define NAN (INFINITY-INFINITY)
# endif