mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* numeric.c (flo_is_finite_p): use finite() if available.
* win32/win32.h (isinf, isnan): define as macro. [ruby-win32:00533] * bcc32/Makefile.sub, win32/Makefile.sub: no longer use missing/isinf.c, missing/isnan.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3708 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
3819849ac1
commit
71e0bb92d1
5 changed files with 32 additions and 28 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
Mon Apr 21 21:25:59 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||
|
||||
* numeric.c (flo_is_finite_p): use finite() if available.
|
||||
|
||||
* win32/win32.h (isinf, isnan): define as macro.
|
||||
[ruby-win32:00533]
|
||||
|
||||
* bcc32/Makefile.sub, win32/Makefile.sub: no longer use
|
||||
missing/isinf.c, missing/isnan.c.
|
||||
|
||||
Mon Apr 21 18:36:28 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||
|
||||
* bignum.c (rb_cstr_to_inum): unnecessarily long buffer was used
|
||||
|
|
|
@ -102,7 +102,7 @@ RFLAGS = $(iconinc)
|
|||
EXTLIBS =
|
||||
!endif
|
||||
LIBS = cw32.lib import32.lib ws2_32.lib $(EXTLIBS)
|
||||
MISSING = acosh.obj crypt.obj win32.obj isinf.obj
|
||||
MISSING = acosh.obj crypt.obj win32.obj
|
||||
|
||||
!ifndef STACK
|
||||
STACK = 0x2000000
|
||||
|
@ -270,6 +270,7 @@ config.h:
|
|||
\#define SIZEOF_DOUBLE 8
|
||||
|
||||
\#define HAVE_DECL_SYS_NERR 1
|
||||
\#define HAVE_ISINF 1
|
||||
\#define HAVE_ISNAN 1
|
||||
\#define HAVE_MEMMOVE 1
|
||||
\#define HAVE_MKDIR 1
|
||||
|
@ -518,8 +519,6 @@ crypt.obj: crypt.c win32.h
|
|||
dup2.obj: dup2.c win32.h
|
||||
finite.obj: finite.c win32.h
|
||||
flock.obj: flock.c win32.h
|
||||
isinf.obj: isinf.c win32.h
|
||||
isnan.obj: isnan.c win32.h
|
||||
memcmp.obj: memcmp.c win32.h
|
||||
memmove.obj: memmove.c win32.h
|
||||
mkdir.obj: mkdir.c win32.h
|
||||
|
|
|
@ -758,8 +758,13 @@ flo_is_finite_p(num)
|
|||
{
|
||||
double value = RFLOAT(num)->value;
|
||||
|
||||
#if HAVE_FINITE
|
||||
if (!finite(value))
|
||||
return Qfalse;
|
||||
#else
|
||||
if (isinf(value) || isnan(value))
|
||||
return Qfalse;
|
||||
#endif
|
||||
|
||||
return Qtrue;
|
||||
}
|
||||
|
|
|
@ -93,7 +93,7 @@ RFLAGS = -r
|
|||
EXTLIBS =
|
||||
!endif
|
||||
LIBS = oldnames.lib user32.lib advapi32.lib wsock32.lib $(EXTLIBS)
|
||||
MISSING = acosh.obj crypt.obj win32.obj isinf.obj isnan.obj
|
||||
MISSING = acosh.obj crypt.obj win32.obj
|
||||
|
||||
ARFLAGS = -machine:$(MACHINE) -out:
|
||||
CC = $(CC) -nologo
|
||||
|
@ -245,6 +245,8 @@ config.h:
|
|||
#define HAVE_STRTOUL 1
|
||||
#define HAVE_FLOCK 1
|
||||
#define HAVE_VSNPRINTF 1
|
||||
#define HAVE_ISINF 1
|
||||
#define HAVE_ISNAN 1
|
||||
#define HAVE_FINITE 1
|
||||
#define HAVE_FMOD 1
|
||||
#define HAVE_FREXP 1
|
||||
|
@ -328,7 +330,7 @@ s,@AR@,$(AR),;t t
|
|||
s,@ARFLAGS@,$(ARFLAGS),;t t
|
||||
s,@LN_S@,$(LN_S),;t t
|
||||
s,@SET_MAKE@,$(SET_MAKE),;t t
|
||||
s,@LIBOBJS@, acosh.obj crypt.obj win32.obj isinf.obj isnan.obj,;t t
|
||||
s,@LIBOBJS@, acosh.obj crypt.obj win32.obj,;t t
|
||||
s,@ALLOCA@,$(ALLOCA),;t t
|
||||
s,@DEFAULT_KCODE@,$(DEFAULT_KCODE),;t t
|
||||
s,@EXEEXT@,.exe,;t t
|
||||
|
@ -516,8 +518,6 @@ crypt.obj: {$(srcdir)}missing/crypt.c
|
|||
dup2.obj: {$(srcdir)}missing/dup2.c
|
||||
finite.obj: {$(srcdir)}missing/finite.c
|
||||
flock.obj: {$(srcdir)}missing/flock.c
|
||||
isinf.obj: {$(srcdir)}missing/isinf.c
|
||||
isnan.obj: {$(srcdir)}missing/isnan.c
|
||||
memcmp.obj: {$(srcdir)}missing/memcmp.c
|
||||
memmove.obj: {$(srcdir)}missing/memmove.c
|
||||
mkdir.obj: {$(srcdir)}missing/mkdir.c
|
||||
|
|
|
@ -175,40 +175,30 @@ extern int do_aspawn(int, char *, char **);
|
|||
extern int kill(int, int);
|
||||
extern pid_t rb_w32_getpid(void);
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#include <float.h>
|
||||
#if !defined __MINGW32__ || defined __NO_ISOCEXT
|
||||
#ifndef isnan
|
||||
#define isnan _isnan
|
||||
#define isnan(x) _isnan(x)
|
||||
#endif
|
||||
#ifndef isinf
|
||||
#define isinf(x) (!_finite(x) && !_isnan(x))
|
||||
#endif
|
||||
#ifndef finite
|
||||
#define finite(x) _finite(x)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef S_ISDIR
|
||||
#ifdef __BORLANDC__
|
||||
#undef S_ISDIR
|
||||
#endif
|
||||
|
||||
#ifdef S_ISFIFO
|
||||
#undef S_ISFIFO
|
||||
#endif
|
||||
|
||||
#ifdef S_ISBLK
|
||||
#undef S_ISBLK
|
||||
#endif
|
||||
|
||||
#ifdef S_ISCHR
|
||||
#undef S_ISCHR
|
||||
#endif
|
||||
|
||||
#ifdef S_ISREG
|
||||
#undef S_ISREG
|
||||
#endif
|
||||
|
||||
#define S_ISDIR(m) (((unsigned short)(m) & S_IFMT) == S_IFDIR)
|
||||
#define S_ISFIFO(m) (((unsigned short)(m) & S_IFMT) == S_IFIFO)
|
||||
#define S_ISBLK(m) (((unsigned short)(m) & S_IFMT) == S_IFBLK)
|
||||
#define S_ISCHR(m) (((unsigned short)(m) & S_IFMT) == S_IFCHR)
|
||||
#define S_ISREG(m) (((unsigned short)(m) & S_IFMT) == S_IFREG)
|
||||
#elif !defined __MINGW32__ || defined __NO_ISOCEXT
|
||||
extern int isinf(double);
|
||||
extern int isnan(double);
|
||||
#endif
|
||||
|
||||
#if !defined S_IRUSR && !defined __MINGW32__
|
||||
|
|
Loading…
Add table
Reference in a new issue