at master 2.1 kB view raw
1From c1c2000c35ff39b09cb70fbdf66a107d3b17a674 Mon Sep 17 00:00:00 2001 2From: Stephan Bergmann <sbergman@redhat.com> 3Date: Wed, 12 Oct 2022 08:40:49 +0200 4Subject: [PATCH] Fix missing #include <time.h> 5MIME-Version: 1.0 6Content-Type: text/plain; charset=UTF-8 7Content-Transfer-Encoding: 8bit 8 9At least on recent Fedora 37 beta, building now failed with 10 11> CLucene/document/DateTools.cpp:26:19: error: ‘gmtime’ was not declared in this scope 12> 26 | tm *ptm = gmtime(&secs); 13> | ^~~~~~ 14 15etc. 16 17As it turns out, after 22f9d40320e3deeaa8d6aaa7a770077c20a21dae "git-svn-id: 18https://clucene.svn.sourceforge.net/svnroot/clucene/branches/lucene2_3_2@2672 1920ef185c-fe11-0410-a618-ba9304b01011" on 2008-06-26 had commented out 20_CL_TIME_WITH_SYS_TIME in clucene-config.h.cmake as "not actually used for 21anything", then cceccfb52917b5f4da447f1cf20c135952d41442 "Presenting DateTools 22and deprecating DateField. DateTools still requires some testing and its own 23unit testing" on 2008-06-29 had introduced this use of it (into then 24src/CLucene/document/DateTools.H). And apparently most build environments have 25silently been happy ever since when the dead leading check for 26_CL_TIME_WITH_SYS_TIME didn't include both <sys/time.h> and <time.h>, but the 27following check for _CL_HAVE_SYS_TIME_H only included <sys/time.h> but not 28<time.h>. 29--- 30 src/shared/CLucene/clucene-config.h.cmake | 3 +-- 31 1 file changed, 1 insertion(+), 2 deletions(-) 32 33diff --git a/src/shared/CLucene/clucene-config.h.cmake b/src/shared/CLucene/clucene-config.h.cmake 34index bd8683a5..6fe0f92b 100644 35--- a/src/shared/CLucene/clucene-config.h.cmake 36+++ b/src/shared/CLucene/clucene-config.h.cmake 37@@ -100,8 +100,7 @@ ${SYMBOL__T} 38 //#cmakedefine _CL_STAT_MACROS_BROKEN 39 40 /* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ 41-//not actually used for anything... 42-//#cmakedefine _CL_TIME_WITH_SYS_TIME 1 43+#cmakedefine _CL_TIME_WITH_SYS_TIME 1 44 45 /* Define that we will be using -fvisibility=hidden, and 46 * make public classes visible using __attribute__ ((visibility("default"))) 47-- 482.37.3 49