Debian Codegraph @

Source/7zip/Common/MyGuidDef.h

raw
1 /*
2 * MyGuidDef.h
3 *
4 * This file is a part of LZMA compression module for NSIS.
5 *
6 * Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
7 * Modifications Copyright (C) 2003-2026 Amir Szekely <[email protected]>
8 *
9 * Licensed under the Common Public License version 1.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 *
12 * Licence details can be found in the file COPYING.
13 *
14 * This software is provided 'as-is', without any express or implied
15 * warranty.
16 */
17
18 #ifndef GUID_DEFINED
19 #define GUID_DEFINED
20
21 #include "Types.h"
22
23 typedef struct {
24 UInt32 Data1;
25 UInt16 Data2;
26 UInt16 Data3;
27 unsigned char Data4[8];
28 } GUID;
29
30 #ifdef __cplusplus
31 #define REFGUID const GUID &
32 #else
33 #define REFGUID const GUID *
34 #endif
35
36 #define REFCLSID REFGUID
37 #define REFIID REFGUID
38
39 #ifdef __cplusplus
40 inline bool operator==(REFGUID g1, REFGUID g2)
41 {
42 for (int i = 0; i < (int)sizeof(g1); i++)
43 if (((unsigned char *)&g1)[i] != ((unsigned char *)&g2)[i])
44 return false;
45 return true;
46 }
47 inline bool operator!=(REFGUID g1, REFGUID g2) { return !(g1 == g2); }
48 #endif
49
50 #endif // GUID_DEFINED
51
52 #ifdef __cplusplus
53 #define MY_EXTERN_C extern "C"
54 #else
55 #define MY_EXTERN_C extern
56 #endif
57
58
59 #ifdef DEFINE_GUID
60 #undef DEFINE_GUID
61 #endif
62
63 #ifdef INITGUID
64 #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
65 MY_EXTERN_C const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
66 #else
67 #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
68 MY_EXTERN_C const GUID name
69 #endif