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.
This commit is contained in:
parent
1aad8088e5
commit
7d19bf5d61
|
@ -35,12 +35,18 @@ typedef const GUID *LPCGUID;
|
||||||
#undef DEFINE_GUID
|
#undef DEFINE_GUID
|
||||||
|
|
||||||
#ifdef INITGUID
|
#ifdef INITGUID
|
||||||
|
#ifdef __cplusplus
|
||||||
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
|
#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 } }
|
{ l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
|
||||||
#else
|
#else
|
||||||
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
|
#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
|
#endif
|
||||||
|
|
||||||
#define DEFINE_OLEGUID(name, l, w1, w2) \
|
#define DEFINE_OLEGUID(name, l, w1, w2) \
|
||||||
|
|
Loading…
Reference in New Issue