|
| 1 | +From 0a92e43809209c210cf77a4d63a255e4093ea73f Mon Sep 17 00:00:00 2001 |
| 2 | +From: =?UTF-8?q?Markus=20M=C3=BCtzel?= < [email protected]> |
| 3 | +Date: Fri, 6 Jun 2025 09:42:02 +0200 |
| 4 | +Subject: [PATCH] Add visibility attributes for MinGW. |
| 5 | + |
| 6 | +--- |
| 7 | + source/common/unicode/platform.h | 4 ++++ |
| 8 | + source/config/icu.pc.in | 1 + |
| 9 | + 2 files changed, 5 insertions(+) |
| 10 | + |
| 11 | +diff --git a/source/common/unicode/platform.h b/source/common/unicode/platform.h |
| 12 | +index 45741a83deb..60be4987eb2 100644 |
| 13 | +--- a/source/common/unicode/platform.h |
| 14 | ++++ b/source/common/unicode/platform.h |
| 15 | +@@ -780,6 +780,8 @@ |
| 16 | + #elif defined(_MSC_VER) || (UPRV_HAS_DECLSPEC_ATTRIBUTE(__dllexport__) && \ |
| 17 | + UPRV_HAS_DECLSPEC_ATTRIBUTE(__dllimport__)) |
| 18 | + # define U_EXPORT __declspec(dllexport) |
| 19 | ++#elif defined (_WIN32) || defined (__CYGWIN__) |
| 20 | ++# define U_EXPORT __attribute__ ((dllexport)) |
| 21 | + #elif defined(__GNUC__) || defined(__open_xl__) |
| 22 | + # define U_EXPORT __attribute__((visibility("default"))) |
| 23 | + #elif (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x550) \ |
| 24 | +@@ -806,6 +808,8 @@ |
| 25 | + UPRV_HAS_DECLSPEC_ATTRIBUTE(__dllimport__)) |
| 26 | + /* Windows needs to export/import data. */ |
| 27 | + # define U_IMPORT __declspec(dllimport) |
| 28 | ++#elif defined (_WIN32) || defined (__CYGWIN__) |
| 29 | ++# define U_IMPORT __attribute__ ((dllimport)) |
| 30 | + #else |
| 31 | + # define U_IMPORT |
| 32 | + #endif |
| 33 | +diff --git a/source/config/icu.pc.in b/source/config/icu.pc.in |
| 34 | +index 4d8db206c2b..9adc2e208a1 100644 |
| 35 | +--- a/source/config/icu.pc.in |
| 36 | ++++ b/source/config/icu.pc.in |
| 37 | +@@ -33,4 +33,5 @@ ICUDESC=International Components for Unicode |
| 38 | + |
| 39 | + Version: @VERSION@ |
| 40 | + Cflags: -I${includedir} |
| 41 | ++Cflags.private: -DU_STATIC_IMPLEMENTATION |
| 42 | + # end of icu.pc.in |
| 43 | +-- |
| 44 | +2.47.1.windows.2 |
| 45 | + |
0 commit comments