diff options
Diffstat (limited to '')
-rw-r--r-- | CPP/Common/MyGuidDef.h | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/CPP/Common/MyGuidDef.h b/CPP/Common/MyGuidDef.h index 38aad6e..ab9993b 100644 --- a/CPP/Common/MyGuidDef.h +++ b/CPP/Common/MyGuidDef.h | |||
@@ -1,8 +1,12 @@ | |||
1 | // Common/MyGuidDef.h | 1 | // Common/MyGuidDef.h |
2 | 2 | ||
3 | // #pragma message "Common/MyGuidDef.h" | ||
4 | |||
3 | #ifndef GUID_DEFINED | 5 | #ifndef GUID_DEFINED |
4 | #define GUID_DEFINED | 6 | #define GUID_DEFINED |
5 | 7 | ||
8 | // #pragma message "GUID_DEFINED" | ||
9 | |||
6 | #include "MyTypes.h" | 10 | #include "MyTypes.h" |
7 | 11 | ||
8 | typedef struct { | 12 | typedef struct { |
@@ -27,31 +31,33 @@ typedef GUID CLSID; | |||
27 | #ifdef __cplusplus | 31 | #ifdef __cplusplus |
28 | inline int operator==(REFGUID g1, REFGUID g2) | 32 | inline int operator==(REFGUID g1, REFGUID g2) |
29 | { | 33 | { |
30 | for (int i = 0; i < (int)sizeof(g1); i++) | 34 | for (unsigned i = 0; i < sizeof(g1); i++) |
31 | if (((unsigned char *)&g1)[i] != ((unsigned char *)&g2)[i]) | 35 | if (((const unsigned char *)&g1)[i] != ((const unsigned char *)&g2)[i]) |
32 | return 0; | 36 | return 0; |
33 | return 1; | 37 | return 1; |
34 | } | 38 | } |
35 | inline int operator!=(REFGUID g1, REFGUID g2) { return !(g1 == g2); } | 39 | inline int operator!=(REFGUID g1, REFGUID g2) { return !(g1 == g2); } |
36 | #endif | 40 | #endif |
37 | 41 | ||
42 | #endif // GUID_DEFINED | ||
43 | |||
44 | #ifndef EXTERN_C | ||
38 | #ifdef __cplusplus | 45 | #ifdef __cplusplus |
39 | #define MY_EXTERN_C extern "C" | 46 | #define EXTERN_C extern "C" |
40 | #else | 47 | #else |
41 | #define MY_EXTERN_C extern | 48 | #define EXTERN_C extern |
42 | #endif | 49 | #endif |
43 | |||
44 | #endif | 50 | #endif |
45 | 51 | ||
46 | |||
47 | #ifdef DEFINE_GUID | 52 | #ifdef DEFINE_GUID |
48 | #undef DEFINE_GUID | 53 | #undef DEFINE_GUID |
49 | #endif | 54 | #endif |
50 | 55 | ||
51 | #ifdef INITGUID | 56 | #ifdef INITGUID |
52 | #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ | 57 | #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ |
53 | MY_EXTERN_C const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } | 58 | EXTERN_C const GUID name; \ |
59 | EXTERN_C const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } | ||
54 | #else | 60 | #else |
55 | #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ | 61 | #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ |
56 | MY_EXTERN_C const GUID name | 62 | EXTERN_C const GUID name |
57 | #endif | 63 | #endif |