From 7224020ca4fd28953e12670f1902828fc1207a13 Mon Sep 17 00:00:00 2001
From: Yavor Doganov <yavor@gnu.org>
Date: Mon, 17 Jul 2023 16:22:44 +0300
Subject: [PATCH 1/3] Move #include "tzdb.h" a bit earlier

---
 ChangeLog           |  5 +++++
 Source/NSTimeZone.m | 10 +++++-----
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e49acf822..f1b3d9259 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2023-07-17  Yavor Doganov  <yavor@gnu.org>
+
+	* Source/NSTimeZone.m: Move #include "tzdb.h" a bit earlier so
+	that the POSIX_TZONES preprocessor conditional is correct.
+
 2023-06-10 Riccardo Mottola <rm@gnu.org>
 
 	* Tests/base/NSURL/Helpers/Launch.h:
diff --git a/Source/NSTimeZone.m b/Source/NSTimeZone.m
index c1c4135d5..6cf4ca2cf 100644
--- a/Source/NSTimeZone.m
+++ b/Source/NSTimeZone.m
@@ -153,6 +153,11 @@
 /* Many systems have this file */
 #define SYSTEM_TIME_FILE @"/etc/localtime"
 
+/* Include public domain code (modified for use here) to parse standard
+ * posix time zone files.
+ */
+#include "tzdb.h"
+
 /* If TZDIR told us where the zoneinfo files are, don't append anything else */
 #ifdef TZDIR
 #define POSIX_TZONES     @""
@@ -163,11 +168,6 @@
 #define BUFFER_SIZE 512
 #define WEEK_MILLISECONDS (7.0*24.0*60.0*60.0*1000.0)
 
-/* Include public domain code (modified for use here) to parse standard
- * posix time zone files.
- */
-#include "tzdb.h"
-
 #if GS_USE_ICU == 1
 static inline int
 _NSToICUTZDisplayStyle(NSTimeZoneNameStyle style)
-- 
2.40.1

