gettimeofday: avoid warning: nested extern declaration of 'localtime'
authorDaniel P. Berrange <berrange@redhat.com>
Mon, 19 Jan 2009 07:13:17 +0000 (08:13 +0100)
committerJim Meyering <meyering@redhat.com>
Mon, 19 Jan 2009 07:24:22 +0000 (08:24 +0100)
* lib/gettimeofday.c: Move extern declaration out of function.

ChangeLog
lib/gettimeofday.c

index b897725aceeb0cf94f56bae6b99cd706b9e36141..b56bb2eb3b587e550d8094011543a2cd296e1365 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-01-19  Daniel P. Berrange  <berrange@redhat.com>
+
+       gettimeofday: avoid warning: nested extern declaration of 'localtime'
+       * lib/gettimeofday.c: Move extern declaration out of function.
+
 2009-01-18  Bruno Haible  <bruno@clisp.org>
 
        * m4/strftime.m4 (gl_FUNC_STRFTIME): Don't test for mblen and mbrlen.
index f190c2dd53800f43906794812731ef2da57435a5..badbf643516f227ed07f4b0f3a24b0a18eba6572 100644 (file)
@@ -41,6 +41,9 @@
 static struct tm tm_zero_buffer;
 static struct tm *localtime_buffer_addr = &tm_zero_buffer;
 
+#undef localtime
+extern struct tm *localtime (time_t const *);
+
 /* This is a wrapper for localtime.  It is used only on systems for which
    gettimeofday clobbers the static buffer used for localtime's result.
 
@@ -50,8 +53,6 @@ static struct tm *localtime_buffer_addr = &tm_zero_buffer;
 struct tm *
 rpl_localtime (time_t const *timep)
 {
-#undef localtime
-  extern struct tm *localtime (time_t const *);
   struct tm *tm = localtime (timep);
 
   if (localtime_buffer_addr == &tm_zero_buffer)