Our team is considering to move from def file to __declspec(dllexport) macro because it has to use mangling name in the *.def files and, that is a tedious task to maintain those ugly looking names there. But we are still doubt is there any benefit from using *.def file over __declspec(dllexport) macro for function export.
Appreciate your suggestions!
.def files can export by ordinal values (@1, @2, ...) rather than by name. This can:
And it can avoid the function name from being decorated, which improves compiler compatibility (i.e. calling conventions difference of __stdcall and __cdecl). Here is an example of exporting undecorated name in dll.