1 // IDecl.h 2 3 #ifndef ZIP7_INC_IDECL_H 4 #define ZIP7_INC_IDECL_H 5 6 #include "../Common/Common.h" 7 #include "../Common/MyUnknown.h" 8 9 #define k_7zip_GUID_Data1 0x23170F69 10 #define k_7zip_GUID_Data2 0x40C1 11 12 #define k_7zip_GUID_Data3_Common 0x278A 13 14 #define k_7zip_GUID_Data3_Decoder 0x2790 15 #define k_7zip_GUID_Data3_Encoder 0x2791 16 #define k_7zip_GUID_Data3_Hasher 0x2792 17 18 #define Z7_DECL_IFACE_7ZIP_SUB(i, _base, groupId, subId) \ 19 Z7_DEFINE_GUID(IID_ ## i, \ 20 k_7zip_GUID_Data1, \ 21 k_7zip_GUID_Data2, \ 22 k_7zip_GUID_Data3_Common, \ 23 0, 0, 0, (groupId), 0, (subId), 0, 0); \ 24 struct Z7_DECLSPEC_NOVTABLE i: public _base 25 26 #define Z7_DECL_IFACE_7ZIP(i, groupId, subId) \ 27 Z7_DECL_IFACE_7ZIP_SUB(i, IUnknown, groupId, subId) 28 29 30 #ifdef COM_DECLSPEC_NOTHROW 31 #define Z7_COMWF_B COM_DECLSPEC_NOTHROW STDMETHODIMP 32 #define Z7_COMWF_B_(t) COM_DECLSPEC_NOTHROW STDMETHODIMP_(t) 33 #else 34 #define Z7_COMWF_B STDMETHODIMP 35 #define Z7_COMWF_B_(t) STDMETHODIMP_(t) 36 #endif 37 38 #if defined(_MSC_VER) && !defined(COM_DECLSPEC_NOTHROW) 39 #define Z7_COM7F_B __declspec(nothrow) STDMETHODIMP 40 #define Z7_COM7F_B_(t) __declspec(nothrow) STDMETHODIMP_(t) 41 #else 42 #define Z7_COM7F_B Z7_COMWF_B 43 #define Z7_COM7F_B_(t) Z7_COMWF_B_(t) 44 #endif 45 46 // #define Z7_COM7F_E Z7_noexcept 47 #define Z7_COM7F_E throw() 48 #define Z7_COM7F_EO Z7_COM7F_E Z7_override 49 #define Z7_COM7F_EOF Z7_COM7F_EO Z7_final 50 #define Z7_COM7F_IMF(f) Z7_COM7F_B f Z7_COM7F_E 51 #define Z7_COM7F_IMF2(t, f) Z7_COM7F_B_(t) f Z7_COM7F_E 52 53 #define Z7_COM7F_PURE(f) virtual Z7_COM7F_IMF(f) =0; 54 #define Z7_COM7F_PURE2(t, f) virtual Z7_COM7F_IMF2(t, f) =0; 55 #define Z7_COM7F_IMP(f) Z7_COM7F_IMF(f) Z7_override Z7_final; 56 #define Z7_COM7F_IMP2(t, f) Z7_COM7F_IMF2(t, f) Z7_override Z7_final; 57 #define Z7_COM7F_IMP_NONFINAL(f) Z7_COM7F_IMF(f) Z7_override; 58 #define Z7_COM7F_IMP_NONFINAL2(t, f) Z7_COM7F_IMF2(t, f) Z7_override; 59 60 #define Z7_IFACE_PURE(name) Z7_IFACEN_ ## name(=0;) 61 #define Z7_IFACE_IMP(name) Z7_IFACEN_ ## name(Z7_override Z7_final;) 62 63 #define Z7_IFACE_COM7_PURE(name) Z7_IFACEM_ ## name(Z7_COM7F_PURE) 64 #define Z7_IFACE_COM7_IMP(name) Z7_IFACEM_ ## name(Z7_COM7F_IMP) 65 #define Z7_IFACE_COM7_IMP_NONFINAL(name) Z7_IFACEM_ ## name(Z7_COM7F_IMP_NONFINAL) 66 67 68 #define Z7_IFACE_DECL_PURE(name) \ 69 DECLARE_INTERFACE(name) \ 70 { Z7_IFACE_PURE(name) }; 71 72 #define Z7_IFACE_DECL_PURE_(name, baseiface) \ 73 DECLARE_INTERFACE_(name, baseiface) \ 74 { Z7_IFACE_PURE(name) }; 75 76 #endif 77