summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-10-07 07:28:43 -0700
committerKaz Kylheku <kaz@kylheku.com>2020-10-07 07:28:43 -0700
commit59f8d2082b2687669d0ec55213776456bfde9506 (patch)
treeacf8c1c80989f6ed481c066704ccdcef0c04a89f /configure
parentdff49e8198641254308cf77cc953742acd5ad935 (diff)
downloadtxr-59f8d2082b2687669d0ec55213776456bfde9506.tar.gz
txr-59f8d2082b2687669d0ec55213776456bfde9506.tar.bz2
txr-59f8d2082b2687669d0ec55213776456bfde9506.zip
New function: time-nsec.
* configure: Test for clock_gettime, generating HAVE_CLOCK_GETTIME symbol in config.h. * time.c (time_sec_nsec): New function. (time_init): time-nsec intrinsic registered. * time.h (time_sec_nsec): Declared. * txr.1: Documented.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure20
1 files changed, 20 insertions, 0 deletions
diff --git a/configure b/configure
index 92e8715d..edbf398b 100755
--- a/configure
+++ b/configure
@@ -3593,6 +3593,26 @@ else
printf "no\n"
fi
+printf "Checking for clock_gettime ... "
+cat > conftest.c <<!
+#include <time.h>
+
+int main(void)
+{
+ struct timespec ts;
+ (void) clock_gettime(CLOCK_REALTIME, &ts);
+ return 0;
+}
+!
+
+if conftest ; then
+ printf "yes\n"
+ printf "#define HAVE_CLOCK_GETTIME 1\n" >> config.h
+ have_sys_types=y
+else
+ printf "no\n"
+fi
+
printf "Checking for loff_t ... "
cat > conftest.c <<!
#include <sys/types.h>