)]}'
{
  "commit": "18144a4bfae687de740f20750cfe6a933db456e3",
  "tree": "d8bf6ce9432cad183c73d6de5c918b0cba5c0b79",
  "parents": [
    "b06d2685c8ca2276cf6693763be1da94b9a90da0"
  ],
  "author": {
    "name": "Jaeden Amero",
    "email": "jaeden@patater.com",
    "time": "Sat Apr 11 09:15:09 2026 +0000"
  },
  "committer": {
    "name": "LIU Hao",
    "email": "lh_mouse@126.com",
    "time": "Fri Apr 17 19:38:19 2026 +0800"
  },
  "message": "headers: i386: Fall back to kernel32 Interlocked\n\nOn i386, GCC cannot inline the __sync_* builtins because the ISA has no\nCMPXCHG or XADD instructions (which were introduced with i486). GCC\nemits calls to library helpers such as __sync_val_compare_and_swap_4\nthat do not exist, causing undefined-reference link errors in any\nprogram that uses the CRT (crt2.o references InterlockedCompareExchange\nvia the _InterlockedCompareExchangePointer intrinsic in crtexe.c):\n\n    ld: crt2.o:crtexe.c:(.text+0x...): undefined reference to `__sync_add_and_fetch_4\u0027\n    ld: crt2.o:crtexe.c:(.text+0x...): undefined reference to `__sync_sub_and_fetch_4\u0027\n    ld: crt2.o:crtexe.c:(.text+0x...): undefined reference to `__sync_fetch_and_add_4\u0027\n    ld: crt2.o:crtexe.c:(.text+0x...): undefined reference to `__sync_val_compare_and_swap_4\u0027\n\nWhen __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 is not defined (as on i386, but\nnot on i486 and up), fall back to the real Interlocked functions\nexported by kernel32.dll for the five functions it provides:\nInterlockedCompareExchange, InterlockedIncrement, InterlockedDecrement,\nInterlockedExchange, and InterlockedExchangeAdd. The functions remain\ninline intrinsics as before: only the implementation body changes when\ntargeting i386.\n\n_InterlockedAdd, _InterlockedAdd64, and _InterlockedCompareExchange64\nalso use __sync_* builtins but are intentionally left alone since\nkernel32.dll does not export InterlockedAdd or 64-bit variants of these\nfunctions (there is no kernel32 function to fall back to).\n\nThe kernel32 imports are declared with __asm__ labels to avoid\ncollisions with the macros (from winnt.h) that map unprefixed names to\nunderscore-prefixed intrinsics. GCC prepends underscores to __asm__\nlabel strings but Clang does not, so a __MINGW_K32_ASM helper handles\nthis portably for both toolchains.\n\nThis fixes https://sourceforge.net/p/mingw-w64/bugs/961/\n\nSigned-off-by: Jaeden Amero \u003cjaeden@patater.com\u003e\nSigned-off-by: LIU Hao \u003clh_mouse@126.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "f123f91202779195a7a233a0d2ecb25cc4b4e227",
      "old_mode": 33188,
      "old_path": "mingw-w64-headers/include/psdk_inc/intrin-impl.h",
      "new_id": "ff007df106ba64986b4af3f56b5dc3e33e6b1adc",
      "new_mode": 33188,
      "new_path": "mingw-w64-headers/include/psdk_inc/intrin-impl.h"
    }
  ]
}
