Skip to content

Commit f5d65f5

Browse files
Fix swift-foundation build
1 parent 989bffc commit f5d65f5

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
From 3828fe6d24735d59d53f073d9021b954d28e5750 Mon Sep 17 00:00:00 2001
2+
From: Yuta Saito <[email protected]>
3+
Date: Mon, 14 Apr 2025 18:20:25 +0000
4+
Subject: [PATCH] [wasm] Stop requiring `TZDIR` and `TZDEFAULT` on WASI
5+
6+
Those constants are not used on WASI in Swift side, so there's no
7+
need to require them in the C headers.
8+
---
9+
Sources/_FoundationCShims/include/_CStdlib.h | 2 +-
10+
1 file changed, 1 insertion(+), 1 deletion(-)
11+
12+
diff --git a/Sources/_FoundationCShims/include/_CStdlib.h b/Sources/_FoundationCShims/include/_CStdlib.h
13+
index 405febc..408a924 100644
14+
--- a/Sources/_FoundationCShims/include/_CStdlib.h
15+
+++ b/Sources/_FoundationCShims/include/_CStdlib.h
16+
@@ -156,7 +156,7 @@
17+
#ifndef TZDEFAULT
18+
#define TZDEFAULT "/etc/localtime"
19+
#endif /* !defined TZDEFAULT */
20+
-#elif TARGET_OS_WINDOWS
21+
+#elif TARGET_OS_WINDOWS || TARGET_OS_WASI
22+
/* not required */
23+
#else
24+
#error "possibly define TZDIR and TZDEFAULT for this platform"
25+
--
26+
2.48.1
27+

0 commit comments

Comments
 (0)