# HG changeset patch # User Daniel P. Berrange # Date 1232349197 -3600 # Node ID e073cd7459e8453f85651b894a069f20c089ceff # Parent 3dd9bde3c382086402d82dd972ce096b4d598998 gettimeofday: avoid warning: nested extern declaration of 'localtime' * lib/gettimeofday.c: Move extern declaration out of function. diff --git a/ChangeLog b/ChangeLog --- 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 --- 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 @@ 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)