1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-04-28 01:00:52 -07:00

Use 'restrict' in gettimeofday arguments, and make ms-w32.h compatible.

This commit is contained in:
Eli Zaretskii 2013-03-28 22:51:26 +02:00
parent 97dababa47
commit 5d611e0450
3 changed files with 9 additions and 4 deletions

View file

@ -99,8 +99,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#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

View file

@ -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

View file

@ -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);