For C++, declare initialised GUIDs to be "extern const" rather than

just "const" to ensure that the initialised GUID is visible to other
modules, and use EXTERN_C rather than just "extern" for the benefit of
MSVC++, which does name mangling on global variables.
oldstable
Troy Rollo 2005-09-02 12:17:52 +00:00 committed by Alexandre Julliard
parent 1aad8088e5
commit 7d19bf5d61
1 changed files with 8 additions and 2 deletions

View File

@ -35,12 +35,18 @@ typedef const GUID *LPCGUID;
#undef DEFINE_GUID
#ifdef INITGUID
#ifdef __cplusplus
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
const GUID name = \
EXTERN_C const GUID name = \
{ l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
#else
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name
const GUID name = \
{ l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
#endif
#else
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
EXTERN_C const GUID name
#endif
#define DEFINE_OLEGUID(name, l, w1, w2) \