Add new switch `HAS_MODF', and conditionalize "missing.c" to use it.
authorChris Hanson <org/chris-hanson/cph>
Fri, 22 Sep 1989 08:45:36 +0000 (08:45 +0000)
committerChris Hanson <org/chris-hanson/cph>
Fri, 22 Sep 1989 08:45:36 +0000 (08:45 +0000)
Change makefile to include "missing.o".

v7/src/microcode/config.h
v7/src/microcode/missing.c
v7/src/microcode/psbmap.h
v7/src/microcode/unxutl/ymkfile

index efafe196d7cbe338b66c628dcd0697cc52bc3e3a..51272582c0dd361a8318241c18d35c95e24b1520 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/config.h,v 9.47 1989/09/20 23:07:08 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/config.h,v 9.48 1989/09/22 08:44:46 cph Exp $
 
 Copyright (c) 1987, 1988, 1989 Massachusetts Institute of Technology
 
@@ -181,6 +181,11 @@ typedef unsigned long SCHEME_OBJECT;
    HAS_FREXP should be defined if the system has the double precision
    procedures ldexp and frexp.  On Unix, look for frexp(3C).
 
+   HAS_MODF should be defined if the system has the double precision
+   procedure modf.  On Unix, look for frexp(3C).  **** This flag is
+   new as of 22-SEP-89; please comment out any incorrect #define's as
+   we haven't been able to test this on all machines.
+
 */
 \f
 /* Possible values for FASL_INTERNAL_FORMAT.  For the most part this
@@ -263,6 +268,7 @@ typedef unsigned long SCHEME_OBJECT;
 #define MAX_FLONUM_EXPONENT    127
 #define HAS_FLOOR
 #define HAS_FREXP
+#define HAS_MODF
 
 /* Not on these, however */
 
@@ -330,6 +336,7 @@ longjmp(Exit_Point, NORMAL_EXIT)
 #define MAX_FLONUM_EXPONENT    1023
 #define HAS_FLOOR
 #define HAS_FREXP
+#define HAS_MODF
 /* C compiler bug in GC_Type */
 #define term_type              int
 #endif
@@ -351,6 +358,7 @@ longjmp(Exit_Point, NORMAL_EXIT)
 #define MAX_FLONUM_EXPONENT    1023
 #define HAS_FLOOR
 #define HAS_FREXP
+#define HAS_MODF
 
 /* C Compiler bug when constant folding and anchor pointing */
 #define And2(x, y)     ((x) ? (y) : false)
@@ -389,6 +397,7 @@ longjmp(Exit_Point, NORMAL_EXIT)
 
 #define HAS_FLOOR
 #define HAS_FREXP
+#define HAS_MODF
 #define HAVE_DOUBLE_TO_LONG_BUG
 
 #endif /* sun */
@@ -406,6 +415,7 @@ longjmp(Exit_Point, NORMAL_EXIT)
 #define MAX_FLONUM_EXPONENT    127
 #include <public.h>
 #define HAS_FREXP
+#define HAS_MODF
 #define STACK_SIZE             4       /* 4K objects */
 #endif
 \f
@@ -455,6 +465,7 @@ longjmp(Exit_Point, NORMAL_EXIT)
 #define FLOATING_ALIGNMENT     0x7     /* Low 3 MBZ for float storage */
 #define HAS_FLOOR
 #define HAS_FREXP
+#define HAS_MODF
 
 #ifndef AVOID_SPECTRUM_TC_KLUDGE
 
@@ -494,6 +505,7 @@ longjmp(Exit_Point, NORMAL_EXIT)
 #define MAX_FLONUM_EXPONENT    1023
 #define HAS_FLOOR
 #define HAS_FREXP
+#define HAS_MODF
 #endif
 
 #ifdef pyr
@@ -524,6 +536,7 @@ longjmp(Exit_Point, NORMAL_EXIT)
 #define MAX_FLONUM_EXPONENT    1023
 #define HAS_FLOOR
 #define HAS_FREXP
+#define HAS_MODF
 #endif
 
 #ifdef mips
index e68777111b80b8d2c64237bd9fa10e984fe99038..9ef6b786aab129190a8de3278191377560e94680 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/missing.c,v 9.23 1989/09/20 23:10:19 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/missing.c,v 9.24 1989/09/22 08:45:25 cph Exp $
 
 Copyright (c) 1987, 1988, 1989 Massachusetts Institute of Technology
 
@@ -34,6 +34,8 @@ MIT in each case. */
 
 /* This file contains utilities potentially missing from the math library. */
 \f
+#ifndef HAS_FREXP
+
 double
 frexp (value, eptr)
      double value;
@@ -146,7 +148,11 @@ ldexp (value, exponent)
   else
     return (x);
 }
+
+#endif /* not HAS_FREXP */
 \f
+#ifndef HAS_MODF
+
 double
 modf (value, iptr)
      double value;
@@ -202,6 +208,10 @@ modf (value, iptr)
   }
 }
 
+#endif /* not HAS_MODF */
+\f
+#ifndef HAS_FLOOR
+
 double
 floor (x)
      double x;
@@ -219,7 +229,9 @@ ceil (x)
   double fraction = (modf (x, (&iptr)));
   return ((fraction > 0) ? (iptr + 1) : iptr);
 }
-\f
+
+#endif /* not HAS_FLOOR */
+
 #ifdef DEBUG_MISSING
 
 #include <stdio.h>
index 12148a6db4a4ac72383d7840778beec1a6a63770..2efc229ffcc84f2f22a1fb5205b838603c2b0fe6 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/psbmap.h,v 9.29 1989/09/20 23:10:51 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/psbmap.h,v 9.30 1989/09/22 08:45:36 cph Exp $
 
 Copyright (c) 1987, 1988, 1989 Massachusetts Institute of Technology
 
@@ -52,11 +52,7 @@ MIT in each case. */
 #include "const.h"
 #include "gccode.h"
 
-#ifdef HAS_FREXP
 extern double frexp(), ldexp();
-#else
-#include "missing.c"
-#endif
 
 #define PORTABLE_VERSION       5
 
index 6a0248ea4592daf431d25c85af98cf51522cd7c8..15a44013411a0b0e7fe4c10cdab05a8114e39d15 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/unxutl/Attic/ymkfile,v 1.9 1989/09/20 23:13:36 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/unxutl/Attic/ymkfile,v 1.10 1989/09/22 08:45:03 cph Exp $
 
 Copyright (c) 1989 Massachusetts Institute of Technology
 
@@ -243,8 +243,8 @@ CFLAGS = -DMIT_SCHEME C_OPTIMIZE_SWITCH C_DEBUG_SWITCH C_SWITCH_MACHINE C_SWITCH
 
 /* Source and object files */
 
-SCHEME_SOURCES = $(X_SOURCES) $(CTERM_SOURCES) $(GRAPHICS_SOURCES) SOURCES_SYSTEM SOURCES_MACHINE $(USER_PRIM_SOURCES)
-SCHEME_OBJECTS = $(X_OBJECTS) $(CTERM_OBJECTS) $(GRAPHICS_OBJECTS) OBJECTS_SYSTEM OBJECTS_MACHINE $(USER_PRIM_OBJECTS) usrdef.o
+SCHEME_SOURCES = $(X_SOURCES) $(CTERM_SOURCES) $(GRAPHICS_SOURCES) SOURCES_SYSTEM SOURCES_MACHINE $(USER_PRIM_SOURCES) missing.c
+SCHEME_OBJECTS = $(X_OBJECTS) $(CTERM_OBJECTS) $(GRAPHICS_OBJECTS) OBJECTS_SYSTEM OBJECTS_MACHINE $(USER_PRIM_OBJECTS) missing.o usrdef.o
 SCHEME_LIB = $(USER_LIBS) $(GRAPHICS_LIBS) $(X_LIB) $(CTERM_LIB) LIB_MATH LIBS_SYSTEM LIBS_MACHINE LIB_DEBUG LIB_STANDARD
 
 SOURCES = \