3 ms·
It is more complicated than that. MSYS2 isn't just Cygwin. It has different environments. MSYS environment is just Cygwin and it uses Itanium IIRC for C and C+
by okanat 2mo ago
It is more complicated than that. MSYS2 isn't just Cygwin. It has different environments.
MSYS environment is just Cygwin and it uses Itanium IIRC for C and C++ non-Win32 calls since it emulates POSIX. If it links with Windows C runtime they use __cdecl. Win32 API calls always use __stdcall convention / ABI.
However, Mingw environments (Mingw64, UCRT, CLANG etc.) are intended for native Windows development, hence, they use normal MSVC __cdecl ABI for C library calls and internal function calls too. Win32 calls are again __stdcall.
Unlike C, for C++ all MSYS environments use Itanium ABI since they link with GNU libstdc++ or Clang libc++. I think it is possible to use MSVC C++ ABI with Clang but it could be complicated since it requires recompilation of at least libc++.
- Joker_vD 2mo agoTL;DR: You can mix and match calling conventions as long as you actually track what piece of (compiled) software uses what convention.