The guard of a function-local static calls __atomic_load_1. The i8086
compiler-rt builtins have it (i8086/atomic.c), so the flag is not
necessary. The link error came from a sysroot with older builtins.
- Remove the flag from the Win16 build and the Win16 test script.
- win16wnd tests a function-local static object.
- docs/win16.md says what to do with an older sysroot.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRTV4u8c9f3gQUmqvq
The Win16 library now has CWinApp, CWnd, the frames (SDI, MDI, mini
frames and splitters), CDialog with DDX, the common dialogs, the
controls, the GDI classes and document/view with printing.
- afxwin16u.h gives the Win32 USER, GDI and KERNEL declarations that
the window classes use; src/win16u.cpp does them with the nearest
16-bit calls, or fails as Win32 fails. include/win16 sends the OLE
headers to the OLE 2 headers of the SDK; the common control types
come from port/include, last on the include path.
- The ON_WM_ macros, OnCommand, the reflection and the MDI code read
the 16-bit packing of WM_COMMAND, WM_ACTIVATE, the scroll, menu,
list box and MDI messages, and WM_CTLCOLOR. GET_WM_COMMAND_* are in
afxwin.h for each target.
- CAfxDlgTemplate writes the 16-bit dialog template. The File New type
dialog keeps the chosen template in its state, not in the dialog
result, which has no room for a far pointer on Win16.
- Registered message entries keep a DWORD_PTR, which holds a far
pointer. The handle maps use a word key on Win16.
- The registry functions use the HKEY_CLASSES_ROOT tree of shell.dll;
profiles go to the INI file. Events, mutexes and semaphores are task
objects. The OLE virtuals are stubs (src/win16ole.cpp).
- tests/run-win16-tests.sh (make check) runs core, memtest and three
window tests (frame and dialog, SDI, MDI) at -O0, -Os and -O2 in
Wine: 15 of 15 pass.
Claude-Session: https://claude.ai/code/session_01B82eRRTV4u8c9f3gQUmqvq
Co-authored-by: Claude <noreply@anthropic.com>