port(2A): port/common Win32 layer, port_logic target and header gate

- Win32Types.h: fixed-width Win32 scalars, pointer-sized handles, static_asserts
- Win32Crt.{h,cpp}: MSVC _snprintf truncation contract, stricmp, timeGetTime wrap
- port_logic static lib linked into libmtgodot; standalone MTGODOT_BUILD_PORT build
- port_header_gate: every port/**.h compiles alone (twice) with its lib's
  40250 Distribute|Win32 defines (NDEBUG, USE_LOD, _DISTRIBUTE)
- script/port_gate.sh: macOS/Android/iOS/Windows(mingw) PASS, Linux BLOCKED

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-09-22 19:57:58 +09:00
co-authored by Claude Opus 5
parent 4521845a69
commit 2bae8d7644
11 changed files with 498 additions and 1 deletions
+20
View File
@@ -119,6 +119,26 @@ extension/third_party/cpython-2.7.18/ # 静态库(2P 批次
`ThingInstance.h`/`GrpBase.h` 等);P0 单元里 `InstanceBase``PythonCharacterManager``PythonPlayer`
`PythonPlayerEventHandler` 的头文件互相包含,必须作为一组串行移植,`ActorInstance.cpp` 排在最前。
2A 当前进度(`script/port_gate.sh` 复现;构建目录 `build-port-gate/`):
- 已完成:`port/common/``Win32Types.h``Win32Crt.{h,cpp}`MSVC `_snprintf` 截断语义、`timeGetTime` 32 位回绕)、
`StdAfx.h`);`port_logic` 目标已链接进 libmtgodot,也可用 `-DMTGODOT_BUILD_EXTENSION=OFF -DMTGODOT_BUILD_PORT=ON`
单独构建;每个 `port/**.h` 独立编译两次的门禁 `port_header_gate``port.common` 测试。编译宏取 40250 发布版
`Metin2Distribute.exe``Distribute|Win32` 配置:所有库 `NDEBUG`GameLib 加 `USE_LOD`UserInterface 加
`USE_LOD;_DISTRIBUTE`;不定义 `WIN32`
- 未完成:D3DX 数学层、闭包头文件照抄(步骤 2)、platform 接口骨架(步骤 4)。
| 平台 | port_gate |
| --- | --- |
| macOS arm64 | PASS(含 `port.common` 测试) |
| Android arm64NDK 27.2API 24 | PASS |
| iOS arm64 | PASSXcode,未签名) |
| Windows x64 | mingw-w64 PASSMSVC 需在 Windows 主机上跑,**BLOCKED** |
| Linux x86_64 | **BLOCKED**(本机无 Linux 工具链;Linux 主机上直接运行脚本) |
已知的无关问题:完整 Android 扩展构建在 `extension/src/net/text_codec.cpp` 失败(bionic 从 API 28 才声明 `iconv`
而构建用 API 24;c9389431 引入);仓库里的 `build-android/` 缓存还指向旧路径 `mtgodot-poc`
### 批次 2R:资源包能力盘点
40250 的读取链不只是 `EterPack.cpp`,还有 `EterPackManager.cpp`(多包覆盖顺序、路径归一化)、