Skip to content

Commit a1b7738

Browse files
committed
icu: fix circular include on visual studio with C
1 parent d70c4cf commit a1b7738

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
From b0a600d2a3f7de6fd817d5b310f1f17f565d81db Mon Sep 17 00:00:00 2001
2+
From: Ignazio Pillai <ignazp@amazon.com>
3+
Date: Wed, 18 Dec 2024 12:49:47 +0100
4+
Subject: [PATCH] Fix circular include on MS Visual Studio
5+
6+
Including ucal.h from a C file on MS VisualStudio triggers a circular include, which triggers a build fail.
7+
---
8+
icu4c/source/common/unicode/platform.h | 6 +++---
9+
1 file changed, 3 insertions(+), 3 deletions(-)
10+
11+
diff --git a/icu4c/source/common/unicode/platform.h b/icu4c/source/common/unicode/platform.h
12+
index b2fcb21ef1..81976eacd8 100644
13+
--- a/icu4c/source/common/unicode/platform.h
14+
+++ b/icu4c/source/common/unicode/platform.h
15+
@@ -728,12 +728,12 @@
16+
/*
17+
* Notes:
18+
* C++11 and C11 require support for UTF-16 literals
19+
- * Doesn't work on Mac C11 (see workaround in ptypes.h)
20+
- * or Cygwin less than 3.5.
21+
+ * Doesn't work on Mac C11 (see workaround in ptypes.h),
22+
+ * MS Visual Studio or Cygwin less than 3.5.
23+
*/
24+
# if defined(__cplusplus)
25+
# define U_HAVE_CHAR16_T 1
26+
-# elif U_PLATFORM_IS_DARWIN_BASED || (U_PLATFORM == U_PF_CYGWIN && CYGWIN_VERSION_DLL_MAJOR < 3005)
27+
+# elif U_PLATFORM_IS_DARWIN_BASED || (U_PLATFORM == U_PF_CYGWIN && CYGWIN_VERSION_DLL_MAJOR < 3005) || defined(_MSC_VER)
28+
# define U_HAVE_CHAR16_T 0
29+
# else
30+
// conformant C11
31+
--
32+
2.38.1.windows.1
33+

gvsbuild/projects/icu.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def __init__(self):
3434
"meson",
3535
"pkgconf",
3636
],
37+
patches=["0001-Fix-circular-include-on-MS-Visual-Studio.patch"],
3738
)
3839

3940
def build(self):

0 commit comments

Comments
 (0)