I installed this.  Jim and I thought it better to complain at
compile-time if someone is really building on an ancient system.  We
suspect that there aren't any such systems active any more, but just
in case, users can define OK_TO_USE_1S_CLOCK.

2006-01-09  Paul Eggert  <[EMAIL PROTECTED]>

        Sync from coreutils.

        * lib/gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
        Report an error at compile-time if only a 1-second nominal clock
        resolution is found.

Index: lib/gettime.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/gettime.c,v
retrieving revision 1.5
diff -p -u -r1.5 gettime.c
--- lib/gettime.c       14 May 2005 06:03:58 -0000      1.5
+++ lib/gettime.c       9 Jan 2006 23:02:07 -0000
@@ -45,8 +45,14 @@ gettime (struct timespec *ts)
     ts->tv_nsec = tv.tv_usec * 1000;
   }
 # else
+
+#  ifndef OK_TO_USE_1S_CLOCK
+#   error "Only 1-second nominal clock resolution found.  Is that intended?" \
+          "If so, compile with the -DOK_TO_USE_1S_CLOCK option."
+#  endif
   ts->tv_sec = time (NULL);
   ts->tv_nsec = 0;
+
 # endif
 
 #endif


_______________________________________________
bug-gnulib mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-gnulib

Reply via email to