I have an existing library for VS on windows, which i want to turn into a compiler and OS agnostic one.

Basically, the code looks like this:

Qt Code:
  1. #define D_CDECL __cdecl
  2. #define D_EXPORT __declspec(dllexport)
  3. #define D_EXTERN extern "C"
  4.  
  5. //...
  6.  
  7. D_EXTERN int D_EXPORT D_CDECL Test( int tst )
To copy to clipboard, switch view to plain text mode 


The documentation of similar Qt macros is very scarce to non-existant, but i found these of interests:


D_EXTERN - Q_EXTERN_C
D_EXPORT - Q_DECL_EXPORT
D_CDECL - ???


So far, so good. (extern_c is a language feature anyways and Q_EXPORT seems to be deprecated in Qt 484 for Q_DECL_EXPORT.)
But what about the cdecl calling convention? How can i get that compiler-generic?

c naming via extern_c doesnt imply the c calling convention via __cdecl in VS, so i have to specify it somehow.

But how?




Furthermore, these may be of interest...but no documentation seems to be available.

Q_EXPORT_PLUGIN

Q_DECL_ALIGN

Q_STANDARD_CALL