view src/win32/7zip/7z/CPP/Common/InitializeStaticLib.h @ 4:5f6f2134e8ce

apu appears to not be used
author Robert McIntyre <rlm@mit.edu>
date Sat, 03 Mar 2012 10:35:58 -0600
parents f9f4f1b99eed
children
line wrap: on
line source
1 // Common/InitializeStaticLib.h
2 //
3 // it's necessary to include this from one cpp file in order to use 7zip as a static library,
4 // otherwise the linker will optimize away some important internals of 7zip.
6 #ifndef __COMMON_INITIALIZESTATICLIB_H
7 #define __COMMON_INITIALIZESTATICLIB_H
9 #define FORCE_REF(dec, var) extern dec var; void* var##ref = (void*)&var;
11 #include "../7zip/Common/DeclareCodecs.h"
12 #include "../7zip/Common/DeclareArcs.h"
14 FORCE_REF(struct CCRCTableInit, g_CRCTableInit)
17 // these don't seem to be necessary with my compiler,
18 // but they're here in case a different compiler more aggressively strips out unreferenced code
19 FORCE_REF(class CBZip2CrcTableInit, g_BZip2CrcTableInit)
20 namespace NCrypto { struct CAesTabInit; FORCE_REF(CAesTabInit, g_AesTabInit) }
21 namespace NBitl { struct CInverterTableInitializer; FORCE_REF(CInverterTableInitializer, g_InverterTableInitializer) }
22 namespace NCompress { namespace NRar3 { class CDistInit; FORCE_REF(CDistInit, g_DistInit) }}
23 namespace NArchive { namespace NLzh { class CCRCTableInit; FORCE_REF(CCRCTableInit, g_CRCTableInit) }}
24 namespace NArchive { namespace N7z { class SignatureInitializer; FORCE_REF(SignatureInitializer, g_SignatureInitializer) }}
25 namespace NArchive{ namespace NRar{ namespace NHeader{ class CMarkerInitializer; FORCE_REF(CMarkerInitializer, g_MarkerInitializer) }}}
26 namespace NArchive { namespace NZip { namespace NSignature{ class CMarkersInitializer; FORCE_REF(CMarkersInitializer, g_MarkerInitializer) }}}
29 #endif