aboutsummaryrefslogtreecommitdiff
path: root/CPP/Common/MyGuidDef.h
diff options
context:
space:
mode:
authorIgor Pavlov <87184205+ip7z@users.noreply.github.com>2021-12-27 00:00:00 +0000
committerIgor Pavlov <87184205+ip7z@users.noreply.github.com>2022-03-18 15:35:13 +0500
commitf19f813537c7aea1c20749c914e756b54a9c3cf5 (patch)
tree816ba62ca7c0fa19f2eb46d9e9d6f7dd7c3a744d /CPP/Common/MyGuidDef.h
parent98e06a519b63b81986abe76d28887f6984a7732b (diff)
download7zip-21.07.tar.gz
7zip-21.07.tar.bz2
7zip-21.07.zip
'21.07'21.07
Diffstat (limited to 'CPP/Common/MyGuidDef.h')
-rw-r--r--CPP/Common/MyGuidDef.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/CPP/Common/MyGuidDef.h b/CPP/Common/MyGuidDef.h
new file mode 100644
index 0000000..38aad6e
--- /dev/null
+++ b/CPP/Common/MyGuidDef.h
@@ -0,0 +1,57 @@
1// Common/MyGuidDef.h
2
3#ifndef GUID_DEFINED
4#define GUID_DEFINED
5
6#include "MyTypes.h"
7
8typedef struct {
9 UInt32 Data1;
10 UInt16 Data2;
11 UInt16 Data3;
12 unsigned char Data4[8];
13} GUID;
14
15#ifdef __cplusplus
16#define REFGUID const GUID &
17#else
18#define REFGUID const GUID *
19#endif
20
21// typedef GUID IID;
22typedef GUID CLSID;
23
24#define REFCLSID REFGUID
25#define REFIID REFGUID
26
27#ifdef __cplusplus
28inline int operator==(REFGUID g1, REFGUID g2)
29{
30 for (int i = 0; i < (int)sizeof(g1); i++)
31 if (((unsigned char *)&g1)[i] != ((unsigned char *)&g2)[i])
32 return 0;
33 return 1;
34}
35inline int operator!=(REFGUID g1, REFGUID g2) { return !(g1 == g2); }
36#endif
37
38#ifdef __cplusplus
39 #define MY_EXTERN_C extern "C"
40#else
41 #define MY_EXTERN_C extern
42#endif
43
44#endif
45
46
47#ifdef DEFINE_GUID
48#undef DEFINE_GUID
49#endif
50
51#ifdef INITGUID
52 #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 } }
54#else
55 #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
56 MY_EXTERN_C const GUID name
57#endif