Original Post
If I enable /Gr in MSVC for my C++ project, which changes the default calling convention to __fastcall (does this matter in 64-bit BTW? it's still an option when I compile to a 64-bit target) then I have a problem calling the functions of a C library that was compiled without this option (I cannot recompile that library).
The library's headers are included in an extern "C" {} block but that doesn't help as I see the linker looking for functions with an @ prefix which indicates it's assuming __fastcall for those.
How can I override the calling convention for this C library without editing its header files and inserting an __cdecl in front of every function in them? I'm looking for a pragma or some other way to make the compiler not assume __fastcall for those library functions. Obviously, I want to also avoid having to remove /Gr and putting explicitly a __fastcall in front of every one of my functions, as there are several hundred of them.
The library's headers are included in an extern "C" {} block but that doesn't help as I see the linker looking for functions with an @ prefix which indicates it's assuming __fastcall for those.
How can I override the calling convention for this C library without editing its header files and inserting an __cdecl in front of every function in them? I'm looking for a pragma or some other way to make the compiler not assume __fastcall for those library functions. Obviously, I want to also avoid having to remove /Gr and putting explicitly a __fastcall in front of every one of my functions, as there are several hundred of them.