From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#9000: patch for higher-resolution time stamps Date: Sat, 23 Jun 2012 11:55:37 -0700 Organization: UCLA Computer Science Department Message-ID: <4FE61129.10004@cs.ucla.edu> References: <4FE4E1EE.7060305@cs.ucla.edu> <83vciibewj.fsf@gnu.org> <83txy2b8xi.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1340477785 9462 80.91.229.3 (23 Jun 2012 18:56:25 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 23 Jun 2012 18:56:25 +0000 (UTC) Cc: 9000@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 23 20:56:24 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SiVVP-0001u2-R4 for geb-bug-gnu-emacs@m.gmane.org; Sat, 23 Jun 2012 20:56:24 +0200 Original-Received: from localhost ([::1]:40224 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SiVVP-0004Lz-Pc for geb-bug-gnu-emacs@m.gmane.org; Sat, 23 Jun 2012 14:56:23 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51200) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SiVVL-0004Lh-Uf for bug-gnu-emacs@gnu.org; Sat, 23 Jun 2012 14:56:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SiVVK-0000Zw-38 for bug-gnu-emacs@gnu.org; Sat, 23 Jun 2012 14:56:19 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44716) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SiVVJ-0000Zr-Vl for bug-gnu-emacs@gnu.org; Sat, 23 Jun 2012 14:56:18 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SiVYw-0003BH-J6 for bug-gnu-emacs@gnu.org; Sat, 23 Jun 2012 15:00:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Jun 2012 19:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9000 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 9000-submit@debbugs.gnu.org id=B9000.134047796712157 (code B ref 9000); Sat, 23 Jun 2012 19:00:02 +0000 Original-Received: (at 9000) by debbugs.gnu.org; 23 Jun 2012 18:59:27 +0000 Original-Received: from localhost ([127.0.0.1]:54262 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SiVYN-0003A2-2W for submit@debbugs.gnu.org; Sat, 23 Jun 2012 14:59:27 -0400 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:48937) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SiVYK-00039u-Et for 9000@debbugs.gnu.org; Sat, 23 Jun 2012 14:59:26 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 754B2A60111; Sat, 23 Jun 2012 11:55:38 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DV4RjIItIw2Y; Sat, 23 Jun 2012 11:55:37 -0700 (PDT) Original-Received: from [192.168.1.10] (pool-108-23-119-2.lsanca.fios.verizon.net [108.23.119.2]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 7949BA60002; Sat, 23 Jun 2012 11:55:37 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 In-Reply-To: <83txy2b8xi.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:61225 Archived-At: 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 + 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 #include -#include /* 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 -# include /* 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 -#include 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 + + Improve port of struct timespec to MS-Windows. + * inc/sys/time.h (struct timespec): Remove, undoing previous change. + 2012-06-23 Eli Zaretskii 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 + + Improve port of struct timespec to MS-Windows. + * s/ms-w32.h (struct timespec) [_MSC_VER]: New decl. + 2012-06-23 Juanma Barranquero * 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 . */ +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__