1
0
mirror of https://github.com/shadowsocks/shadowsocks-libev.git synced 2026-09-24 00:45:06 +00:00
Files
shadowsocks-libev/third_party/LibuvWindows.cmake
Max Lv bdc77408cb Rename to shadowsocks-c with libuv, async DNS and CI lint (#3051)
Rename the project to shadowsocks-c while retaining ss-* commands, the embedding ABI, and legacy library/package lookup compatibility.

Replace libev with bundled libuv for IOCP/kqueue event backends, expand asynchronous runtime DNS coverage, and add actionlint/Ruff with strict clang-tidy failure handling. Validate native platforms, static builds, packaging, interoperability, sanitizers, and canonical/legacy consumers.

All 22 hosted checks pass at reviewed head a8493250eb.
2026-09-11 14:18:37 +08:00

24 lines
1.2 KiB
CMake

# libuv 1.52.1 passes const char ** to a converter that writes char **.
# GCC 14+ rejects this. Keep the archive untouched and use a mutable temporary
# in the extracted source, assigning it to the const public field afterwards.
if(WIN32)
set(uv_util "${uv_SOURCE}/src/win/util.c")
file(READ "${uv_util}" uv_util_content)
set(uv_old [=[ uv__convert_utf16_to_utf8(cpu_brand,
cpu_brand_size / sizeof(WCHAR),
&(cpu_info->model));]=])
set(uv_new [=[ char* model = NULL;
uv__convert_utf16_to_utf8(cpu_brand,
cpu_brand_size / sizeof(WCHAR),
&model);
cpu_info->model = model;]=])
string(FIND "${uv_util_content}" "${uv_old}" uv_old_offset)
string(FIND "${uv_util_content}" "${uv_new}" uv_new_offset)
if(NOT uv_old_offset EQUAL -1)
string(REPLACE "${uv_old}" "${uv_new}" uv_util_content "${uv_util_content}")
file(WRITE "${uv_util}" "${uv_util_content}")
elseif(uv_new_offset EQUAL -1)
message(FATAL_ERROR "Bundled libuv changed; review the Windows CPU-info compatibility fix")
endif()
endif()