all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 9000@debbugs.gnu.org
Subject: bug#9000: patch for higher-resolution time stamps
Date: Sat, 23 Jun 2012 11:55:37 -0700	[thread overview]
Message-ID: <4FE61129.10004@cs.ucla.edu> (raw)
In-Reply-To: <83txy2b8xi.fsf@gnu.org>

On 06/23/2012 03:48 AM, Eli Zaretskii wrote:
>  . do not assume that 'struct timespec' is defined on time.h, or on
>    any other MS-Windows system header
>  . do not use gnulib's time.h (as that requires Sed to edit time.in.h)

OK, thanks, here's a proposed patch to do that.
I'd rather leave gnulib alone, since struct timeval has
nothing to do with sys/time.h in POSIX.

=== modified file 'ChangeLog'
--- ChangeLog	2012-06-23 17:25:56 +0000
+++ ChangeLog	2012-06-23 18:51:45 +0000
@@ -1,5 +1,10 @@
 2012-06-23  Paul Eggert  <eggert@cs.ucla.edu>
 
+	Improve port of struct timespec to MS-Windows.
+	* lib/stat-time.h, lib/timespec.h, lib/utimens.h:
+	Do not include sys/time.h.  This reverts the most recent change,
+	so that these files stay in step with gnulib.
+
 	Merge from gnulib.
 	* m4/getopt.m4: Copy new version from gnulib, incorporating:
 	getopt-gnu: Handle suboptimal getopt_long's abbreviation handling.

=== modified file 'lib/stat-time.h'
--- lib/stat-time.h	2012-06-23 10:22:59 +0000
+++ lib/stat-time.h	2012-06-23 18:51:45 +0000
@@ -22,7 +22,6 @@
 
 #include <sys/stat.h>
 #include <time.h>
-#include <sys/time.h>
 
 /* STAT_TIMESPEC (ST, ST_XTIM) is the ST_XTIM member for *ST of type
    struct timespec, if available.  If not, then STAT_TIMESPEC_NS (ST,

=== modified file 'lib/timespec.h'
--- lib/timespec.h	2012-06-23 10:22:59 +0000
+++ lib/timespec.h	2012-06-23 18:51:45 +0000
@@ -20,7 +20,6 @@
 # define TIMESPEC_H
 
 # include <time.h>
-# include <sys/time.h>
 
 /* Return negative, zero, positive if A < B, A == B, A > B, respectively.
 

=== modified file 'lib/utimens.h'
--- lib/utimens.h	2012-06-23 10:22:59 +0000
+++ lib/utimens.h	2012-06-23 18:51:45 +0000
@@ -1,5 +1,4 @@
 #include <time.h>
-#include <sys/time.h>
 int fdutimens (int, char const *, struct timespec const [2]);
 int utimens (char const *, struct timespec const [2]);
 int lutimens (char const *, struct timespec const [2]);

=== modified file 'nt/ChangeLog'
--- nt/ChangeLog	2012-06-23 10:22:59 +0000
+++ nt/ChangeLog	2012-06-23 18:51:45 +0000
@@ -1,3 +1,8 @@
+2012-06-23  Paul Eggert  <eggert@cs.ucla.edu>
+
+	Improve port of struct timespec to MS-Windows.
+	* inc/sys/time.h (struct timespec): Remove, undoing previous change.
+
 2012-06-23  Eli Zaretskii  <eliz@gnu.org>
 
 	Fix the MS-Windows build broken by revno 108687.

=== modified file 'nt/inc/sys/time.h'
--- nt/inc/sys/time.h	2012-06-23 10:22:59 +0000
+++ nt/inc/sys/time.h	2012-06-23 18:51:45 +0000
@@ -17,15 +17,8 @@
   int		tz_dsttime;	/* type of dst correction */
 };
 
-struct timespec
-{
-  time_t	tv_sec;		/* seconds */
-  long int	tv_nsec;	/* nanoseconds */
-};
-
 void gettimeofday (struct timeval *, struct timezone *);
 
 #endif /* SYS_TIME_H_INCLUDED */
 
 /* end of sys/time.h */
-

=== modified file 'src/ChangeLog'
--- src/ChangeLog	2012-06-23 16:56:47 +0000
+++ src/ChangeLog	2012-06-23 18:51:45 +0000
@@ -1,3 +1,8 @@
+2012-06-23  Paul Eggert  <eggert@cs.ucla.edu>
+
+	Improve port of struct timespec to MS-Windows.
+	* s/ms-w32.h (struct timespec) [_MSC_VER]: New decl.
+
 2012-06-23  Juanma Barranquero  <lekktu@gmail.com>
 
 	* w32.c (ltime): Add return type and declare static.

=== modified file 'src/s/ms-w32.h'
--- src/s/ms-w32.h	2012-06-23 10:22:59 +0000
+++ src/s/ms-w32.h	2012-06-23 18:54:35 +0000
@@ -296,6 +296,15 @@
 #define utime	  _utime
 #endif
 
+#ifdef _MSC_VER
+/* MSVC does not define struct timespec in <time.h>.  */
+struct timespec
+{
+  time_t	tv_sec;		/* seconds */
+  long int	tv_nsec;	/* nanoseconds */
+};
+#endif
+
 /* This is hacky, but is necessary to avoid warnings about macro
    redefinitions using the SDK compilers.  */
 #ifndef __STDC__





  parent reply	other threads:[~2012-06-23 18:55 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-05  6:40 bug#9000: patch for higher-resolution time stamps Paul Eggert
2011-07-05  6:57 ` bug#9000: More-compatible proposal, using (HIGH LOW USEC PSEC) " Paul Eggert
2011-07-06 17:00   ` bug#9000: Update time patch for Frandom, pthread_sigmask, etc Paul Eggert
2012-05-04 20:52 ` bug#9000: 2012-05-04 version of patch Paul Eggert
2012-05-27  3:08   ` Paul Eggert
2012-06-22 21:21 ` bug#9000: patch for higher-resolution time stamps Paul Eggert
2012-06-23  8:39   ` Eli Zaretskii
2012-06-23 10:48     ` Eli Zaretskii
2012-06-23 17:57       ` Paul Eggert
2012-06-23 19:09         ` Eli Zaretskii
2012-06-23 19:42           ` Eli Zaretskii
2012-06-23 22:45             ` Paul Eggert
2012-06-24  2:57               ` Eli Zaretskii
2012-06-24  4:31                 ` Paul Eggert
2012-06-24 19:26                   ` Eli Zaretskii
2012-06-23 18:55       ` Paul Eggert [this message]
2012-06-23 19:08         ` Eli Zaretskii
2012-06-23 22:34           ` Paul Eggert
2012-06-24 17:23             ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FE61129.10004@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=9000@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.