aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2001-01-29 22:40:50 +0000
committerJeff Johnston <jjohnstn@redhat.com>2001-01-29 22:40:50 +0000
commit3aaa66f813d099dbb04e637459e168800d231aa3 (patch)
treee414ca81677237109cb042c9a3c907496893f59d
parent2f3ea37bc8710a775cc1174c496c7fa559f95cdd (diff)
downloadnewlib-3aaa66f813d099dbb04e637459e168800d231aa3.zip
newlib-3aaa66f813d099dbb04e637459e168800d231aa3.tar.gz
newlib-3aaa66f813d099dbb04e637459e168800d231aa3.tar.bz2
2001-01-29 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/math.h (signgam): Change to errno-like solution using a function to return the address of the real signgam. * libc/reent/signgam.c: New file containing __signgam(). * libc/reent/Makefile.am: Added signgam.c to list of files. * libc/reent/Makefile.in: Regenerated.
-rw-r--r--newlib/ChangeLog8
-rw-r--r--newlib/libc/include/math.h6
-rw-r--r--newlib/libc/reent/Makefile.am1
-rw-r--r--newlib/libc/reent/Makefile.in8
-rw-r--r--newlib/libc/reent/signgam.c16
5 files changed, 35 insertions, 4 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index 0e05f7e..994eee9 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,11 @@
+2001-01-29 Jeff Johnston <jjohnstn@redhat.com>
+
+ * libc/include/math.h (signgam): Change to errno-like solution
+ using a function to return the address of the real signgam.
+ * libc/reent/signgam.c: New file containing __signgam().
+ * libc/reent/Makefile.am: Added signgam.c to list of files.
+ * libc/reent/Makefile.in: Regenerated.
+
2001-01-25 Alexandre Oliva <aoliva@redhat.com>
* libc/sys/sh/syscalls.c (_times): New.
diff --git a/newlib/libc/include/math.h b/newlib/libc/include/math.h
index f092aff..255bf3b 100644
--- a/newlib/libc/include/math.h
+++ b/newlib/libc/include/math.h
@@ -185,8 +185,12 @@ extern float dremf _PARAMS((float, float));
#endif /* ! defined (_REENT_ONLY) */
/* The gamma functions use a global variable, signgam. */
+#ifndef _REENT_ONLY
+#define signgam (*__signgam())
+extern int *__signgam _PARAMS((void));
+#endif /* ! defined (_REENT_ONLY) */
-extern __IMPORT int signgam;
+#define __signgam_r(ptr) ((ptr)->_new._reent._gamma_signgam)
/* The exception structure passed to the matherr routine. */
diff --git a/newlib/libc/reent/Makefile.am b/newlib/libc/reent/Makefile.am
index 87a847e..655168a 100644
--- a/newlib/libc/reent/Makefile.am
+++ b/newlib/libc/reent/Makefile.am
@@ -18,6 +18,7 @@ lib_a_SOURCES = \
readr.c \
signalr.c \
sbrkr.c \
+ signgam.c \
statr.c \
timer.c \
unlinkr.c \
diff --git a/newlib/libc/reent/Makefile.in b/newlib/libc/reent/Makefile.in
index 7c1f931..568d42d 100644
--- a/newlib/libc/reent/Makefile.in
+++ b/newlib/libc/reent/Makefile.in
@@ -100,6 +100,7 @@ lib_a_SOURCES = \
readr.c \
signalr.c \
sbrkr.c \
+ signgam.c \
statr.c \
timer.c \
unlinkr.c \
@@ -141,7 +142,8 @@ LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
lib_a_LIBADD =
lib_a_OBJECTS = closer.o reent.o impure.o execr.o fstatr.o linkr.o \
-lseekr.o openr.o readr.o signalr.o sbrkr.o statr.o timer.o unlinkr.o writer.o
+lseekr.o openr.o readr.o signalr.o sbrkr.o signgam.o statr.o timer.o \
+unlinkr.o writer.o
CFLAGS = @CFLAGS@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
@@ -151,7 +153,7 @@ DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = tar
+TAR = gtar
GZIP_ENV = --best
SOURCES = $(lib_a_SOURCES)
OBJECTS = $(lib_a_OBJECTS)
@@ -237,7 +239,7 @@ distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
if test -f $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
- cp -pr $$/$$file $(distdir)/$$file; \
+ cp -pr $$d/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
diff --git a/newlib/libc/reent/signgam.c b/newlib/libc/reent/signgam.c
new file mode 100644
index 0000000..9053866
--- /dev/null
+++ b/newlib/libc/reent/signgam.c
@@ -0,0 +1,16 @@
+/* The signgam variable is stored in the reentrancy structure. This
+ function returns its address for use by the macro signgam defined in
+ math.h. */
+
+#include <math.h>
+#include <reent.h>
+
+#ifndef _REENT_ONLY
+
+int *
+__signgam ()
+{
+ return &_REENT->_new._reent._gamma_signgam;
+}
+
+#endif