Browse Source

fix(icu4c): correct icu4c compile error due to at_quick_exit not been declared (#7478)

ZHUO Qiang 1 month ago
parent
commit
ce6af85a70
1 changed files with 18 additions and 0 deletions
  1. 18 0
      packages/i/icu4c/xmake.lua

+ 18 - 0
packages/i/icu4c/xmake.lua

@@ -137,6 +137,24 @@ package("icu4c")
     end)
 
     on_install("@!windows and !wasm", function (package)
+        if package:version() and package:is_plat("macosx") then
+            local file_path = path.join("source", "common", "uposixdefs.h")
+            if package:version():eq("77.1") then
+                io.replace(
+                    file_path,
+                    "#ifdef _XOPEN_SOURCE",
+                    "#if 1 // #ifdef _XOPEN_SOURCE",
+                    {plain = true}
+                )
+                io.replace(
+                    file_path,
+                    "#define _POSIX_C_SOURCE 200809L",
+                    "// #define _POSIX_C_SOURCE 200809L",
+                    {plain = true}
+                )
+            end
+        end
+
         import("package.tools.autoconf")
 
         os.cd("source")