)]}'
{
  "commit": "4517417c018c12de387207e51e0f3728c5164e50",
  "tree": "579d657c85524940b195626262fc601f18b6908d",
  "parents": [
    "4e83914fe65350fbaf1e4292583a327aaade71be"
  ],
  "author": {
    "name": "Martin Storsjö",
    "email": "martin@martin.st",
    "time": "Sat Apr 27 00:40:44 2024 +0300"
  },
  "committer": {
    "name": "Martin Storsjö",
    "email": "martin@martin.st",
    "time": "Fri Sep 27 00:30:15 2024 +0300"
  },
  "message": "headers: Use asm() to redirect symbols towards extern __mingw vararg functions\n\nThis avoids having to rely on inline functions for capturing\nthe variable arguments into a va_list and passing it to the\nother v- prefixed function.\n\nFor the inline functions, in C++ we used plain C++ inline, while\nwe use static inline in C. (We need to use non-static inline in\nC++ mode, for C++ module builds, where such stdio functions are\nreexported by the C++ module.)\n\nUsing non-static inline functions can cause conflicts, if some\nobject files are built with __USE_MINGW_ANSI_STDIO enabled, and\nothers with it disabled. In such a case, both object files would\ndefine a global comdat symbol e.g. \"wprintf\", and the linker would\npick either definition and use for all callers.\n\nBy redirecting the symbols with asm(), via __MINGW_ASM_CALL, there\u0027s\nno conflict.\n\nThis also fixes https://github.com/mstorsjo/llvm-mingw/issues/438:\n\nThe fact that the inlines are non-static in C++ mode also can\ncause other problems. The inline functions redirect towards the\n__mingw_*printf functions, which do the formatting, and finally\ncall __ms_fwprintf to do the outputting. With short import libraries,\nthe import library redirect from __ms_fwprintf towards the imported\nfunction fwprintf, is handled with a weak alias. But as we already\nhad a nonstatic function \"fwprintf\" (the inline function), this gets\nlinked and used instead of actually importing the \"fwprintf\" function\nfrom msvcrt.dll.\n\nBy not using an inline function for the toplevel redirect, it doesn\u0027t\ninterfere with the import library __ms_fwprintf alias.\n\nThis doesn\u0027t seem to have been an issue for regular fprintf, as those\ninline functions aren\u0027t wrapped in extern \"C\" {}, which causes the\ninline function to get mangled differently, avoiding that problem.\n\nSigned-off-by: Martin Storsjö \u003cmartin@martin.st\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "ae5bcdaf0bbf59901e057839c64a93d31afb7997",
      "old_mode": 33188,
      "old_path": "mingw-w64-headers/crt/stdio.h",
      "new_id": "a8f5c978000e83ef507c8768e4f7266ac8aea5d7",
      "new_mode": 33188,
      "new_path": "mingw-w64-headers/crt/stdio.h"
    },
    {
      "type": "modify",
      "old_id": "f5720fb9a722d1345420cf1f2404bc1c794b71fa",
      "old_mode": 33188,
      "old_path": "mingw-w64-headers/crt/wchar.h",
      "new_id": "717e470c1dc0c34eef2b79d58d4feeacd1d91a76",
      "new_mode": 33188,
      "new_path": "mingw-w64-headers/crt/wchar.h"
    }
  ]
}
