From 4cd86dbe9f7701134781562689d1a30d735eb9f2 Mon Sep 17 00:00:00 2001 From: usa Date: Thu, 7 Feb 2008 02:14:54 +0000 Subject: [PATCH] * missing/lgamma_r.c (lgamma_r): some compilers don't permit dividing by literal 0.0. use const variable instead. * {bcc32,win32,wince}/Makefile.sub (MISSING): add lgamma_r.obj and tgamma.obj. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 8 ++++++++ bcc32/Makefile.sub | 4 ++-- missing/lgamma_r.c | 3 ++- win32/Makefile.sub | 4 ++-- wince/Makefile.sub | 3 ++- 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4a845a778f..fec6dd5eb0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Thu Feb 7 11:11:02 2008 NAKAMURA Usaku + + * missing/lgamma_r.c (lgamma_r): some compilers don't permit dividing + by literal 0.0. use const variable instead. + + * {bcc32,win32,wince}/Makefile.sub (MISSING): add lgamma_r.obj and + tgamma.obj. + Thu Feb 7 10:39:21 2008 Tanaka Akira * math.c (math_gamma): new method Math.gamma. diff --git a/bcc32/Makefile.sub b/bcc32/Makefile.sub index fd0afa8583..6d2dc4867b 100644 --- a/bcc32/Makefile.sub +++ b/bcc32/Makefile.sub @@ -156,7 +156,7 @@ EXTLIBS = MEMLIB = !endif LIBS = $(MEMLIB) cw32i.lib import32.lib ws2_32.lib $(EXTLIBS) -MISSING = acosh.obj crypt.obj erf.obj strlcat.obj strlcpy.obj win32.obj +MISSING = acosh.obj crypt.obj erf.obj lgamma_r.obj strlcat.obj strlcpy.obj tgamma.obj win32.obj !ifndef STACK STACK = 0x2000000 @@ -393,7 +393,7 @@ s,@LN_S@,$(LN_S),;t t s,@SET_MAKE@,MFLAGS = -$$(MAKEFLAGS),;t t s,@RM@,$$(top_srcdir:/=\)\win32\rm.bat,;t t s,@CP@,copy > nul,;t t -s,@LIBOBJS@, acosh.obj crypt.obj erf.obj strlcat.obj strlcpy.obj win32.obj,;t t +s,@LIBOBJS@, $(MISSING),;t t s,@ALLOCA@,$(ALLOCA),;t t s,@DEFAULT_KCODE@,$(DEFAULT_KCODE),;t t s,@EXEEXT@,.exe,;t t diff --git a/missing/lgamma_r.c b/missing/lgamma_r.c index 70b6259c6b..856cc83288 100644 --- a/missing/lgamma_r.c +++ b/missing/lgamma_r.c @@ -51,8 +51,9 @@ lgamma_r(double x, int *signp) double i, f, s; f = modf(-x, &i); if (f == 0.0) { + static const double zero = 0.0; *signp = 1; - return 1.0/0.0; + return 1.0/zero; } *signp = (fmod(i, 2.0) != 0.0) ? 1 : -1; s = sin(PI * x); diff --git a/win32/Makefile.sub b/win32/Makefile.sub index 41dc50ed7f..dd7f7dba26 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -172,7 +172,7 @@ EXTLIBS = LIBS = oldnames.lib user32.lib advapi32.lib shell32.lib ws2_32.lib $(EXTLIBS) !endif !if !defined(MISSING) -MISSING = acosh.obj crypt.obj erf.obj strlcpy.obj strlcat.obj win32.obj +MISSING = acosh.obj crypt.obj erf.obj lgamma_r.obj strlcpy.obj strlcat.obj tgamma.obj win32.obj !endif ARFLAGS = -machine:$(MACHINE) -out: @@ -251,7 +251,7 @@ INSTALLED_LIST= .installed.list WINMAINOBJ = winmain.$(OBJEXT) !endif MINIOBJS = dmydln.$(OBJEXT) dmyencoding.$(OBJEXT) dmytranscode.$(OBJEXT) miniprelude.$(OBJEXT) -LIBOBJS = acosh.obj crypt.obj erf.obj strlcpy.obj strlcat.obj win32.obj $(LIBOBJS) +LIBOBJS = $(MISSING) $(LIBOBJS) !ifndef COMMON_LIBS COMMON_LIBS = m diff --git a/wince/Makefile.sub b/wince/Makefile.sub index 66ac864205..29a57b8c39 100644 --- a/wince/Makefile.sub +++ b/wince/Makefile.sub @@ -26,7 +26,8 @@ XLDFLAGS = -stack:$(STACK) -subsystem:$(SUBSYSTEM) !endif LIBS = coredll.lib ceshell.lib winsock.lib $(EXTLIBS) MISSING = acosh.obj crypt.obj dup2.obj erf.obj hypot.obj \ - isinf.obj isnan.obj strftime.obj strlcat.obj strlcpy.obj win32.obj \ + isinf.obj isnan.obj lgamma.obj strftime.obj strlcat.obj strlcpy.obj + tgamma.obj win32.obj \ assert.obj direct.obj errno.obj io_wce.obj process_wce.obj \ signal_wce.obj stdio.obj stdlib.obj string_wce.obj \ time_wce.obj wince.obj winsock2.obj \