diff options
author | Andy Schwerin <schwerin@10gen.com> | 2013-12-05 14:52:36 -0500 |
---|---|---|
committer | Andy Schwerin <schwerin@10gen.com> | 2013-12-09 14:37:40 -0500 |
commit | 3100d120989881a47b9efbaaad5aec49980301d4 (patch) | |
tree | 03f76a37ed5cde3f0c1b51073ff00e4853a4c5f7 /src/mongo/platform/compiler_msvc.h | |
parent | 86848b30c3014247ab27fdff38ffaa36c1baa2fa (diff) | |
download | mongo-3100d120989881a47b9efbaaad5aec49980301d4.tar.gz |
SERVER-3364 Add macros for putting visibility and calling convention declarations on declarations.
Also SERVER-5650.
MONGO_COMPILER_API_EXPORT Puts the "export visibility" declaration on a type,
function or variable.
MONGO_COMPILER_API_IMPORT Puts the "import from library" declaration on a type,
function or variable.
MONGO_COMPILER_API_CALLING_CONVENTION Labels a function declaration with its
calling convention.
Diffstat (limited to 'src/mongo/platform/compiler_msvc.h')
-rw-r--r-- | src/mongo/platform/compiler_msvc.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mongo/platform/compiler_msvc.h b/src/mongo/platform/compiler_msvc.h index a2207009785..1155e7d6edd 100644 --- a/src/mongo/platform/compiler_msvc.h +++ b/src/mongo/platform/compiler_msvc.h @@ -29,3 +29,15 @@ #define MONGO_COMPILER_ALIGN_TYPE(ALIGNMENT) __declspec( align( ALIGNMENT ) ) #define MONGO_COMPILER_ALIGN_VARIABLE(ALIGNMENT) __declspec( align( ALIGNMENT ) ) + +#define MONGO_COMPILER_API_EXPORT __declspec(dllexport) +#define MONGO_COMPILER_API_IMPORT __declspec(dllimport) + +#ifdef _M_IX86 +// 32-bit x86 supports multiple of calling conventions. We build supporting the cdecl convention +// (most common). By labeling our exported and imported functions as such, we do a small favor to +// 32-bit Windows developers. +#define MONGO_COMPILER_API_CALLING_CONVENTION __cdecl +#else +#define MONGO_COMPILER_API_CALLING_CONVENTION +#endif |