On 1/13/25 05:17, Manuela Friedrich wrote:
It seems that your commit 1ee9daa91818f5d4ab6937352453813fa333e105
fails with:
localtime.c(309): error C2099: initializer is not a constant
Thanks for reporting that. Which compiler are you using and what version
and what compiler flags are you using?
Does the following uninstalled patch fix things for you? If not, what's
the value of _MSC_VER when you use your compiler flags?
diff --git a/private.h b/private.h
index 0a546e02..3e64da4e 100644
--- a/private.h
+++ b/private.h
@@ -26,7 +26,11 @@
because RHEL 7 (whose GCC defaults to C89) extended life cycle
support (ELS) is scheduled to end on 2028-06-30. */
#ifndef PORT_TO_C89
-# define PORT_TO_C89 0
+# if defined _MSC_VER && _MSC_VER < 1800
+# define PORT_TO_C89 1
+# else
+# define PORT_TO_C89 0
+# endif
#endif
/* SUPPORT_C89 means the tzcode library should support C89 callers
Perhaps we could use the patch with a different value in place of 1800,
or perhaps we should just remove the " && _MSC_VER < 1800".
Microsoft says[1] that it didn't add support for C99-style compound
literals until Visual Studio 2013. Are you using an older version of
MSVC? If so, it's past end-of-life[2] and I doubt whether we should
worry about it.
[1]:
https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2013/hh409293(v=vs.120)?redirectedfrom=MSDN
[2]:
https://devblogs.microsoft.com/visualstudio/support-ends-for-older-versions-of-visual-studio-feb2022/