changeset 40015:a4bc639f0003

localtime-buffer: Avoid endless recursion in localtime and gmtime. * lib/localtime-buffer.c: Undefine localtime and gmtime before use.
author Bruno Haible <bruno@clisp.org>
date Thu, 13 Dec 2018 12:00:22 +0100
parents be8d2daa572e
children 9edd1d1403bb
files ChangeLog lib/localtime-buffer.c
diffstat 2 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Dec 13 11:28:32 2018 +0100
+++ b/ChangeLog	Thu Dec 13 12:00:22 2018 +0100
@@ -1,3 +1,8 @@
+2018-12-13  Bruno Haible  <bruno@clisp.org>
+
+	localtime-buffer: Avoid endless recursion in localtime and gmtime.
+	* lib/localtime-buffer.c: Undefine localtime and gmtime before use.
+
 2018-12-13  Bruno Haible  <bruno@clisp.org>
 
 	localeconv tests: Avoid test failure on Cygwin.
--- a/lib/localtime-buffer.c	Thu Dec 13 11:28:32 2018 +0100
+++ b/lib/localtime-buffer.c	Thu Dec 13 12:00:22 2018 +0100
@@ -34,6 +34,7 @@
 
 struct tm *
 rpl_localtime (time_t const *timep)
+#undef localtime
 {
   struct tm *tm = localtime (timep);
 
@@ -46,6 +47,7 @@
 /* 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);