>From 29a4693af90fe3b22475a867b61d0f2102a84d6e Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Thu, 30 Jul 2015 13:47:44 -0700
Subject: [PROPOSED PATCH] Port localtime.c's gmtime to Visual Studio 2013

Problem reported by Kees Dekker in:
http://mm.icann.org/pipermail/tz/2015-July/022563.html
* localtime.c (gmtime_r): Define before using,
in case <time.h> doesn't declare it.
---
 localtime.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/localtime.c b/localtime.c
index 94006df..ded8f7b 100644
--- a/localtime.c
+++ b/localtime.c
@@ -1502,12 +1502,6 @@ gmtsub(struct state const *sp, time_t const *timep, int_fast32_t offset,
 	return result;
 }
 
-struct tm *
-gmtime(const time_t *timep)
-{
-  return gmtime_r(timep, &tm);
-}
-
 /*
 * Re-entrant version of gmtime.
 */
@@ -1519,6 +1513,12 @@ gmtime_r(const time_t *timep, struct tm *tmp)
   return gmtsub(gmtptr, timep, 0, tmp);
 }
 
+struct tm *
+gmtime(const time_t *timep)
+{
+  return gmtime_r(timep, &tm);
+}
+
 #ifdef STD_INSPIRED
 
 struct tm *
-- 
2.1.4

