From: Eli Zaretskii Date: Thu, 28 Mar 2013 20:51:26 +0000 (+0200) Subject: Use 'restrict' in gettimeofday arguments, and make ms-w32.h compatible. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~2026^2~229^2~63^2~71 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5d611e04506c5d34c823ea06fc4b27ff715a493e;p=emacs.git Use 'restrict' in gettimeofday arguments, and make ms-w32.h compatible. --- 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);