r6.1.1:CALLING_CONVENTION

From liblfds.org
Jump to navigation Jump to search

Source File

/test/src/abstraction.h

Define

#define CALLING_CONVENTION  [calling convention]

Parameters

No parameters.

Return Value

No return value.

Notes

It is possible for the calling convention for a thread function to differ from the default the compiler is using to compile the code. This is the case under Windows. Accordingly, it is necessary to have a define which indicates the calling convention for the thread prototype.

Examples

On Windows, with the Microsoft C compiler, the calling convention for a thread function is WINAPI (this is a define which turns into __stdcall).

As such, the implementation of CALLING_CONVENTION on Windows with the Microsoft C compiler looks like this;

#define CALLING_CONVENTION  WINAPI

Under GCC, the default calling convention is used and as such, the define is not set, e.g.;

#define CALLING_CONVENTION

See Also