-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
None
-
C Drivers
-
None
-
None
-
None
-
None
-
None
-
None
Drop support for compiling the MongoDB C Driver libraries with an alternative default calling convention and expecting the ABI of exported functions to remain unchanged.
Per Visual Studio 2015 documentation (the current minimum required VS version), quote:
__cdecl is the default calling convention for C and C++ programs. ... On ARM and x64 processors, __cdecl is accepted but typically ignored by the compiler. By convention on ARM and x64, arguments are passed in registers when possible, and subsequent arguments are passed on the stack. ... Because the C naming and calling conventions are the default, the only time you must use __cdecl in x86 code is when you have specified the /Gv (vectorcall), /Gz (stdcall), or /Gr (fastcall) compiler option. The /Gd compiler option forces the __cdecl calling convention.
Downstream projects using an alternative default calling convention will need to compile translation units which include MongoDB C++ Driver library headers with the same default calling convention as what was used to build the libraries to be linked. This can be done on a per-TU basis with its external linkage functions explicitly declared with their own projects' alternative default calling convention. This is described in CXX-3310.
- is related to
-
CXX-3310 Remove __cdecl from exported symbol declarations
-
- Backlog
-