summaryrefslogtreecommitdiffstats
path: root/arith.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2012-04-09 10:37:21 -0700
committerKaz Kylheku <kaz@kylheku.com>2012-04-09 10:37:21 -0700
commit468116022d26ccd21b97c2e33eaba38c6ff07cc5 (patch)
tree814da78a2bd74ff8bfb20a374b2d0838447aa506 /arith.c
parent405e7884dd00bfdac508d93851d898b5f7d5e4e1 (diff)
downloadtxr-468116022d26ccd21b97c2e33eaba38c6ff07cc5.tar.gz
txr-468116022d26ccd21b97c2e33eaba38c6ff07cc5.tar.bz2
txr-468116022d26ccd21b97c2e33eaba38c6ff07cc5.zip
NetBSD port.
* arith.c (bignum_dbl_ipt): Added missing #if HAVE_DOUBLE_INTPTR_T around function * configure: NetBSD's shell is too pathetic to expand "$@" properly when there are no positional arguments, so I applied the ${@+"$@"} trick. (make): New variable. GNU make might be known only as gmake, so we now detect the command for our own use within the configure script and also for giving the user advice on what command to use for building. Put in a fix so that the attempt to run $make --version does not bail the script under "set -e" if that command terminates unsuccessfully. The check for clashing names has been moved earlier, so that the renaming #define's appear early in config.h (so config.h itself can rely on the renames). The identifier longlong_t has been added to the potential clash list. NetBSD exposes this identifier in spite of -D_POSIX_SOURCE=2, and it clashes with our longlong_t. The tests for integers wider than long long has been modified to actually compile a multiplication of two long-long-s into the wider precision. On the NetBSD system, with gcc 4.1.3, I found that the __int128 type is there, but doesn't actually work; compilation of arith.c bails with an internal compiler error. We now get this internal error at configure time and avoid using the type.
Diffstat (limited to 'arith.c')
-rw-r--r--arith.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arith.c b/arith.c
index f06e77b6..de8d782e 100644
--- a/arith.c
+++ b/arith.c
@@ -68,6 +68,8 @@ val bignum(cnum cn)
return n;
}
+#if HAVE_DOUBLE_INTPTR_T
+
static val bignum_dbl_ipt(double_intptr_t di)
{
val n = make_bignum();
@@ -75,6 +77,8 @@ static val bignum_dbl_ipt(double_intptr_t di)
return n;
}
+#endif
+
val normalize(val bignum)
{
if (mp_cmp_mag(mp(bignum), &NUM_MAX_MP) == MP_GT) {