From d2bd7d7b9823cab4bffb7e43a66361f93fcfb461 Mon Sep 17 00:00:00 2001 From: usa Date: Fri, 26 Jan 2018 16:38:38 +0000 Subject: [PATCH] need to declare the prototype of nan() if missing * include/ruby/missing.h (nan): need to declare the prototype of nan() if missing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- include/ruby/missing.h | 4 ++++ win32/Makefile.sub | 3 +++ 2 files changed, 7 insertions(+) diff --git a/include/ruby/missing.h b/include/ruby/missing.h index cda0aea164..68a90aeb96 100644 --- a/include/ruby/missing.h +++ b/include/ruby/missing.h @@ -185,6 +185,10 @@ RUBY_EXTERN int isnan(double); # endif #endif +#ifndef HAVE_NAN +RUBY_EXTERN double nan(const char *); +#endif + #ifndef HAVE_NEXTAFTER RUBY_EXTERN double nextafter(double x, double y); #endif diff --git a/win32/Makefile.sub b/win32/Makefile.sub index 73b26b3073..a853399d00 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -736,6 +736,9 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub #define HAVE_FLOCK 1 #define HAVE_ISNAN 1 #define HAVE_FINITE 1 +!if $(RT_VAR) >= 120 +#define HAVE_NAN 1 +!endif #define HAVE_HYPOT 1 #define HAVE_FMOD 1 #define HAVE_FREXP 1