aboutsummaryrefslogtreecommitdiffstats
path: root/scmfig.h
diff options
context:
space:
mode:
Diffstat (limited to 'scmfig.h')
-rwxr-xr-x[-rw-r--r--]scmfig.h78
1 files changed, 44 insertions, 34 deletions
diff --git a/scmfig.h b/scmfig.h
index a8e8667..07b91f4 100644..100755
--- a/scmfig.h
+++ b/scmfig.h
@@ -403,39 +403,6 @@ rgx.c init_rgx(); regcomp and regexec. */
# endif
#endif
-/* Define BIGDIG to an integer type whose size is smaller than long if
- you want bignums. BIGRAD is one greater than the biggest BIGDIG. */
-/* Define DIGSTOOBIG if the digits equivalent to a long won't fit in a long. */
-#ifdef BIGNUMS
-# ifdef _UNICOS
-# define DIGSTOOBIG
-# if (1L << 31) <= USHRT_MAX
-# define BIGDIG unsigned short
-# else
-# define BIGDIG unsigned int
-# endif
-# define BITSPERDIG 32
-# else
-# define BIGDIG unsigned short
-# define BITSPERDIG (sizeof(BIGDIG)*CHAR_BIT)
-# endif
-# define BIGRAD (1L << BITSPERDIG)
-# define DIGSPERLONG ((sizet)((sizeof(long)*CHAR_BIT+BITSPERDIG-1)/BITSPERDIG))
-# define BIGUP(x) ((unsigned long)(x) << BITSPERDIG)
-# define BIGDN(x) ((x) >> BITSPERDIG)
-# define BIGLO(x) ((x) & (BIGRAD-1))
-/* NUMDIGS_MAX is the maximum number of digits for BIGNUMS */
-# ifndef NUMDIGS_MAX
-# define NUMDIGS_MAX 1000
-# endif
-#endif
-
-#ifndef BIGDIG
-# ifndef FLOATS
-# define INUMS_ONLY
-# endif
-#endif
-
#ifndef __builtin_expect
# ifndef __GNUC__
# define __builtin_expect(expr, expected) (expr)
@@ -630,6 +597,45 @@ extern ints_infot *ints_info;
#endif
#define INTBUFLEN (5+LONG_BIT)
+/* Define BIGDIG to an integer type whose size is smaller than long if
+ you want bignums. BIGRAD is one greater than the biggest BIGDIG. */
+/* Define DIGSTOOBIG if the digits equivalent to a long won't fit in a long. */
+#ifdef BIGNUMS
+# define SBIGLONG long
+# define UBIGLONG unsigned SBIGLONG
+# ifdef _UNICOS
+# define DIGSTOOBIG
+# if (1L << 31) <= USHRT_MAX
+# define BIGDIG unsigned short
+# else
+# define BIGDIG unsigned int
+# endif
+# define BITSPERDIG 32
+# else
+# if INT_MAX < LONG_MAX
+# define BIGDIG unsigned int
+# else
+# define BIGDIG unsigned short
+# endif
+# endif
+# define BITSPERDIG (sizeof(BIGDIG)*CHAR_BIT)
+# define BIGRAD (1L << BITSPERDIG)
+# define DIGSPERLONG ((sizet)((sizeof(UBIGLONG))/sizeof(BIGDIG)))
+# define BIGUP(x) (((UBIGLONG)(x)) << BITSPERDIG)
+# define BIGDN(x) (((UBIGLONG)(x)) >> BITSPERDIG)
+# define BIGLO(x) ((x) & (BIGRAD-1L))
+/* NUMDIGS_MAX is the maximum number of digits for BIGNUMS */
+# ifndef NUMDIGS_MAX
+# define NUMDIGS_MAX 1000
+# endif
+#endif
+
+#ifndef BIGDIG
+# ifndef FLOATS
+# define INUMS_ONLY
+# endif
+#endif
+
/* FLOBUFLEN is the maximum number of characters neccessary for the
printed or string representation of an inexact number. */
@@ -747,6 +753,10 @@ typedef SCM *SCMPTR;
# endif
#endif
+#ifdef __APPLE__
+# include <unistd.h>
+#endif
+
#ifdef macintosh
# include <unistd.h>
#endif
@@ -805,7 +815,7 @@ typedef SCM *SCMPTR;
#endif
#define SCM_OPENCALL(line) {int gcs = 0;\
- while (!0) {errno = 0; if (line) break;\
+ while (!0) {errno = 0; if ((line)) break;\
if (0==gcs++ && SCM_NEED_FDS(errno)) \
gc_for_open_files();\
else if (!SCM_INTERRUPTED(errno)) break;}}