summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2013-03-28 22:51:26 +0200
committerEli Zaretskii <eliz@gnu.org>2013-03-28 22:51:26 +0200
commit5d611e04506c5d34c823ea06fc4b27ff715a493e (patch)
tree7ff31eb069b445f8bb880e1c1bc681bee73419bf
parent97dababa47e5b2133f18f05f415dcf42c7066f84 (diff)
downloademacs-5d611e04506c5d34c823ea06fc4b27ff715a493e.tar.gz
Use 'restrict' in gettimeofday arguments, and make ms-w32.h compatible.
-rw-r--r--nt/inc/ms-w32.h6
-rw-r--r--nt/inc/sys/time.h5
-rw-r--r--src/w32.c2
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 <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
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);