aboutsummaryrefslogtreecommitdiffstats
path: root/scmfig.h
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2017-03-03 00:56:40 -0800
committerBryan Newbold <bnewbold@robocracy.org>2017-08-02 00:09:46 -0700
commit879f4fa041cfdefee655eb877f1a91f86a9c62b7 (patch)
treebc68ac058e5d0a7cf8e7815cbe1070fd60e75589 /scmfig.h
parentd13fcf5c0bd68f67059b2561c28c40b55e1117a3 (diff)
downloadscm-879f4fa041cfdefee655eb877f1a91f86a9c62b7.tar.gz
scm-879f4fa041cfdefee655eb877f1a91f86a9c62b7.zip
New upstream version 5f2
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;}}