diff options
-rw-r--r-- | lib/localtime-buffer.c | 60 | ||||
-rw-r--r-- | lib/localtime-buffer.h | 27 | ||||
-rw-r--r-- | m4/localtime-buffer.m4 | 21 |
3 files changed, 0 insertions, 108 deletions
diff --git a/lib/localtime-buffer.c b/lib/localtime-buffer.c deleted file mode 100644 index 141849c5461..00000000000 --- a/lib/localtime-buffer.c +++ /dev/null @@ -1,60 +0,0 @@ -/* Provide access to the last buffer returned by localtime() or gmtime(). - - Copyright (C) 2001-2003, 2005-2007, 2009-2020 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see <https://www.gnu.org/licenses/>. */ - -/* written by Jim Meyering */ - -#include <config.h> - -/* Specification. */ -#include "localtime-buffer.h" - -#if GETTIMEOFDAY_CLOBBERS_LOCALTIME || TZSET_CLOBBERS_LOCALTIME - -static struct tm tm_zero_buffer; -struct tm *localtime_buffer_addr = &tm_zero_buffer; - -/* This is a wrapper for localtime. - - On the first call, record the address of the static buffer that - localtime uses for its result. */ - -struct tm * -rpl_localtime (time_t const *timep) -#undef localtime -{ - struct tm *tm = localtime (timep); - - if (localtime_buffer_addr == &tm_zero_buffer) - localtime_buffer_addr = tm; - - return tm; -} - -/* Same as above, since gmtime and localtime use the same buffer. */ -struct tm * -rpl_gmtime (time_t const *timep) -#undef gmtime -{ - struct tm *tm = gmtime (timep); - - if (localtime_buffer_addr == &tm_zero_buffer) - localtime_buffer_addr = tm; - - return tm; -} - -#endif diff --git a/lib/localtime-buffer.h b/lib/localtime-buffer.h deleted file mode 100644 index 3801742f7ba..00000000000 --- a/lib/localtime-buffer.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Provide access to the last buffer returned by localtime() or gmtime(). - - Copyright (C) 2001-2003, 2005-2007, 2009-2020 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see <https://www.gnu.org/licenses/>. */ - -/* written by Jim Meyering */ - -#include <time.h> - -#if GETTIMEOFDAY_CLOBBERS_LOCALTIME || TZSET_CLOBBERS_LOCALTIME - -/* The address of the last buffer returned by localtime() or gmtime(). */ -extern struct tm *localtime_buffer_addr; - -#endif diff --git a/m4/localtime-buffer.m4 b/m4/localtime-buffer.m4 deleted file mode 100644 index 09df3c97f25..00000000000 --- a/m4/localtime-buffer.m4 +++ /dev/null @@ -1,21 +0,0 @@ -# localtime-buffer.m4 serial 1 -dnl Copyright (C) 2017-2020 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -AC_DEFUN([gl_LOCALTIME_BUFFER_DEFAULTS], -[ - NEED_LOCALTIME_BUFFER=0 -]) - -dnl Macro invoked from other modules, to signal that the compilation of -dnl module 'localtime-buffer' is needed. -AC_DEFUN([gl_LOCALTIME_BUFFER_NEEDED], -[ - AC_REQUIRE([gl_LOCALTIME_BUFFER_DEFAULTS]) - AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS]) - NEED_LOCALTIME_BUFFER=1 - REPLACE_GMTIME=1 - REPLACE_LOCALTIME=1 -]) |