port 2A step 2: copy the 40250 header closure into the port mirror

76 closure headers (EterBase, EterLocale, EterPack, EterLib, GameLib, MilesLib,
EffectLib, SphereLib, EterImageLib) copied by the new port_copy.py (CP949->UTF-8,
LF, include-path case only); platform-class headers go to the mirror path too, as
the interface platform/ implements. Six manual `// PORT:` edits (Random, Singleton,
Pool, Stl, Utils, FlyTarget).

- common/D3D8Types.h: D3D8 value types with SDK values/layout, opaque COM interfaces
- common/shim/sdk (d3d8/d3dx8/mss) on every platform, common/shim/win32 off Windows
- Win32Types/Win32Crt: HRESULT, GUID, LARGE_INTEGER, LOGFONT/TEXTMETRIC, _atoi64,
  CRITICAL_SECTION on std::recursive_mutex
- header gate prepends each library's StdAfx.h (40250's precompiled header)

port_gate: macOS, Android, iOS, Windows (mingw) PASS; Linux BLOCKED (no toolchain).
ScriptLib/EterPythonLib/UserInterface wait for 2P (their StdAfx includes Python).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-09-22 20:27:57 +09:00
co-authored by Claude Opus 5
parent 0f2eee0b24
commit fc47582017
98 changed files with 7645 additions and 41 deletions
+18
View File
@@ -6,6 +6,7 @@
#include "Win32Types.h"
#include <cstdarg>
#include <cstdlib>
#include <cstring>
#if !defined(_WIN32)
@@ -21,9 +22,15 @@ inline int stricmp(const char* a, const char* b) { return strcasecmp(a, b); }
inline int _strnicmp(const char* a, const char* b, size_t n) { return strncasecmp(a, b, n); }
inline int strnicmp(const char* a, const char* b, size_t n) { return strncasecmp(a, b, n); }
inline int _strcmpi(const char* a, const char* b) { return strcasecmp(a, b); }
char* _strlwr(char* s);
char* _strupr(char* s);
// EterBase/StdAfx.h maps `atoi` to `_atoi64` (and `fileno` to `_fileno`) for MSVC >= 1400.
inline INT64 _atoi64(const char* s) { return std::strtoll(s, nullptr, 10); }
#define _fileno fileno
// MSVC `_snprintf`/`_vsnprintf`: when the output is longer than `count`, `count` bytes are written
// with no terminator and -1 is returned; exactly `count` bytes are written unterminated and
// `count` is returned; otherwise the output is terminated and its length returned.
@@ -38,4 +45,15 @@ int _snprintf(char* buf, size_t count, const char* fmt, ...)
DWORD timeGetTime();
DWORD GetTickCount();
// Recursive, like the Win32 critical section. Storage holds a std::recursive_mutex.
struct CRITICAL_SECTION
{
alignas(16) unsigned char storage[128];
};
typedef CRITICAL_SECTION* LPCRITICAL_SECTION;
void InitializeCriticalSection(LPCRITICAL_SECTION cs);
void DeleteCriticalSection(LPCRITICAL_SECTION cs);
void EnterCriticalSection(LPCRITICAL_SECTION cs);
void LeaveCriticalSection(LPCRITICAL_SECTION cs);
#endif // !_WIN32