From 5d611e04506c5d34c823ea06fc4b27ff715a493e Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 28 Mar 2013 22:51:26 +0200 Subject: [PATCH] Use 'restrict' in gettimeofday arguments, and make ms-w32.h compatible. --- nt/inc/ms-w32.h | 6 +++++- nt/inc/sys/time.h | 5 +++-- src/w32.c | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h index cd183c917c4..6cbec2bdaaf 100644 --- a/nt/inc/ms-w32.h +++ b/nt/inc/ms-w32.h @@ -99,8 +99,12 @@ along with GNU Emacs. If not, see . */ #endif #ifdef __GNUC__ -# define restrict __restrict__ +/* config.h may have defined already. */ +# ifndef restrict +# define restrict __restrict__ +# endif #else + /* FIXME: should we define to __restrict, which MSVC supports? */ # define restrict #endif diff --git a/nt/inc/sys/time.h b/nt/inc/sys/time.h index 391898ef122..87ad9d3ff0d 100644 --- a/nt/inc/sys/time.h +++ b/nt/inc/sys/time.h @@ -36,8 +36,9 @@ struct timezone #endif /* This needs to be compatible with Posix signature, in order to pass - the configure test for the type of the second argument. */ -int gettimeofday (struct timeval *, struct timezone *); + the configure test for the type of the second argument. See + m4/gettimeofday.m4. */ +int gettimeofday (struct timeval *restrict, struct timezone *restrict); #define ITIMER_REAL 0 #define ITIMER_PROF 1 diff --git a/src/w32.c b/src/w32.c index 6933ddfed83..0fa5970124a 100644 --- a/src/w32.c +++ b/src/w32.c @@ -2395,7 +2395,7 @@ get_emacs_configuration_options (void) /* Emulate gettimeofday (Ulrich Leodolter, 1/11/95). */ int -gettimeofday (struct timeval *tv, struct timezone *tz) +gettimeofday (struct timeval *restrict tv, struct timezone *restrict tz) { struct _timeb tb; _ftime (&tb); -- 2.39.2