summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2012-04-08 19:23:58 -0700
committerKaz Kylheku <kaz@kylheku.com>2012-04-08 19:23:58 -0700
commit1928aa26ceab8601049565a9064d68ff76dc25c3 (patch)
tree6608c1d80a0910f7cebfcd1e8838783d79ccb4c7 /configure
parentd6d824b58bf2257a6cc50354a083699b7d739e19 (diff)
downloadtxr-1928aa26ceab8601049565a9064d68ff76dc25c3.tar.gz
txr-1928aa26ceab8601049565a9064d68ff76dc25c3.tar.bz2
txr-1928aa26ceab8601049565a9064d68ff76dc25c3.zip
* arith.c (bignum): Previously static function now exposed as external.
* arith.h (bignum): Declared. * configure: Added check for tm_gmtoff and tm_tmzone fields being present in struct tm. * eval.c (eval_init): New intrinsic functions: time, time-usec. * lib.c (num): If the cnum is outside of the fixnum range, then construct a bignum. (time_sec, time_sec_usec): New functions. * lib.h (mut): Slight change to macro to eliminate compiler warning. (time_sec, time_sec_usec): Declared. * txr.1: Stub section for time and time-usec. * txr.vim: Highlighting for time and time-usec.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure37
1 files changed, 37 insertions, 0 deletions
diff --git a/configure b/configure
index 46667045..b91551b2 100755
--- a/configure
+++ b/configure
@@ -1109,6 +1109,43 @@ done
printf "done\n"
#
+# Check for fields inside struct tm
+#
+
+printf "Printf detecting timezone fields in struct tm ..."
+
+tm_gmtoff=
+tm_tmzone=
+
+for try_field in tm_gmtoff __tm_gmtoff ; do
+ cat > conftest.c <<!
+#include <time.h>
+int x = sizeof ((struct tm *) 0)->$try_field;
+!
+ rm -f conftest.o
+ if make conftest.o > conftest.err 2>&1 ; then
+ printf "#define HAVE_TM_GMTOFF 1\n" >> config.h
+ printf "#define TM_GMTOFF %s\n" $try_field >> config.h
+ break
+ fi
+done
+
+for try_field in tm_zone __tm_zone ; do
+ cat > conftest.c <<!
+#include <time.h>
+int x = sizeof ((struct tm *) 0)->$try_field;
+!
+ rm -f conftest.o
+ if make conftest.o > conftest.err 2>&1 ; then
+ printf "#define HAVE_TM_ZONE 1\n" >> config.h
+ printf "#define TM_ZONE %s\n" $try_field >> config.h
+ break
+ fi
+done
+
+printf "done\n"
+
+#
# Extra debugging.
#