From 4f22bbb2d1d1f3a7a218e2d8d363f94a071151c9 Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Fri, 3 Jun 2022 13:08:19 -0400 Subject: buildsystem - USE_64BIT_ICALTIME_T -> LIBICAL_ENABLE_64BIT_ICALTIME_T namespace the cmake options --- CMakeLists.txt | 17 ++++++++++++----- ReleaseNotes.txt | 2 ++ config.h.cmake | 6 +++--- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a8ae773..bb8925e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,8 +66,10 @@ # Set to build using a 32bit time_t (ignored unless building with MSVC on Windows) # Default=false (use the default size of time_t) # -# -DUSE_64BIT_ICALTIME_T=[true|false] -# Experimental: Redirect icaltime_t (and related functions) to a 64-bit version of time_t rather than to time_t. +# -DLIBICAL_ENABLE_64BIT_ICALTIME_T=[true|false] +# Redirect icaltime_t (and related functions) to a 64-bit version of time_t rather than to the +# C standard library time_t. Intended for use on 32-bit systems which have a 64-bit time_t +# (such as `__time64_t` on Windows) available. # Default=false (use plain time_t) # # -DLIBICAL_BUILD_TESTING=[true|false] @@ -330,13 +332,18 @@ if(WIN32) endif() # define icaltime_t -libical_option(USE_64BIT_ICALTIME_T "Experimental: Redirect icaltime_t (and related functions) to a 64-bit version of time_t rather than to time_t." False) -if(USE_64BIT_ICALTIME_T) +libical_option(LIBICAL_ENABLE_64BIT_ICALTIME_T + "Redirect icaltime_t and related functions to a 64-bit version of time_t rather than to the \ + C standard library time_t. Intended for use on 32-bit systems which have a 64-bit time_t available. \ + May not be implemented on all platforms yet" + False +) +if(LIBICAL_ENABLE_64BIT_ICALTIME_T) if(MSVC) set(ICAL_ICALTIME_T_TYPE "__time64_t") else() message(FATAL_ERROR - "Option USE_64BIT_ICALTIME_T is not supported with this compiler or architecture.") + "Option LIBICAL_ENABLE_64BIT_ICALTIME_T is not supported with this compiler or architecture.") endif() else() set(ICAL_ICALTIME_T_TYPE "time_t") diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index da0598f3..77f411ca 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -6,6 +6,8 @@ Version 3.1.0 (NOT RELEASED YET): * MSVC 2013 or higher (when building on Windows with MSVC) * For the C++ bindings, a C++11 compliant compiler is required * Requires CMake v3.11.0 or higher + * New CMake option "LIBICAL_ENABLE_64BIT_ICALTIME_T" to use 64-bit time_t implementations + on 32-bit systems (where available and supported. Windows-only so far) * libical-glib requires glib 2.38 or higher * libical-glib requires a C11 compliant compiler * draft-ietf-calext-eventpub-extensions-19 (RFC 9073) support added diff --git a/config.h.cmake b/config.h.cmake index 904cf704..f99a739d 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -525,8 +525,8 @@ typedef ssize_t IO_SSIZE_T; /* * Substitute functions for those from time.h but working with icaltime_t instead of time_t. */ -#cmakedefine USE_64BIT_ICALTIME_T 1 -#if (defined(USE_64BIT_ICALTIME_T) && (SIZEOF_TIME_T != 8)) +#cmakedefine LIBICAL_ENABLE_64BIT_ICALTIME_T 1 +#if (defined(LIBICAL_ENABLE_64BIT_ICALTIME_T) && (SIZEOF_TIME_T != 8)) #if defined(_MSC_VER) #define icaltime(timer) _time64(timer) #define icalctime(timer) _ctime64(timer) @@ -534,7 +534,7 @@ typedef ssize_t IO_SSIZE_T; #define icalgmtime_r(tp,tmp) (_gmtime64(tp)?(*(tmp)=*_gmtime64(tp),(tmp)):0) #define icallocaltime_r(tp,tmp) (_localtime64(tp)?(*(tmp)=*_localtime64(tp),(tmp)):0) #else -#error "This compiler is not supported together with the 'USE_64BIT_ICALTIME_T' option." +#error "This compiler is not supported together with the 'LIBICAL_ENABLE_64BIT_ICALTIME_T' option." #endif #else #define icaltime(timer) time(timer) -- cgit v1.2.1