From b4c5933136d31eeb6d8abc2301044a5a7dfe4676 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Mon, 19 Jan 2009 08:13:17 +0100 Subject: [PATCH] gettimeofday: avoid warning: nested extern declaration of 'localtime' * lib/gettimeofday.c: Move extern declaration out of function. --- ChangeLog | 5 +++++ lib/gettimeofday.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b897725ac..b56bb2eb3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-01-19 Daniel P. Berrange + + gettimeofday: avoid warning: nested extern declaration of 'localtime' + * lib/gettimeofday.c: Move extern declaration out of function. + 2009-01-18 Bruno Haible * m4/strftime.m4 (gl_FUNC_STRFTIME): Don't test for mblen and mbrlen. diff --git a/lib/gettimeofday.c b/lib/gettimeofday.c index f190c2dd5..badbf6435 100644 --- a/lib/gettimeofday.c +++ b/lib/gettimeofday.c @@ -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) -- 2.11.0