diff src/win32/7zip/7z/CPP/Common/InitializeStaticLib.h @ 1:f9f4f1b99eed

importing src directory
author Robert McIntyre <rlm@mit.edu>
date Sat, 03 Mar 2012 10:31:27 -0600
parents
children
line wrap: on
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/win32/7zip/7z/CPP/Common/InitializeStaticLib.h	Sat Mar 03 10:31:27 2012 -0600
     1.3 @@ -0,0 +1,29 @@
     1.4 +// Common/InitializeStaticLib.h
     1.5 +//
     1.6 +// it's necessary to include this from one cpp file in order to use 7zip as a static library,
     1.7 +// otherwise the linker will optimize away some important internals of 7zip.
     1.8 +
     1.9 +#ifndef __COMMON_INITIALIZESTATICLIB_H
    1.10 +#define __COMMON_INITIALIZESTATICLIB_H
    1.11 +
    1.12 +#define FORCE_REF(dec, var) extern dec var; void* var##ref = (void*)&var;
    1.13 +
    1.14 +#include "../7zip/Common/DeclareCodecs.h"
    1.15 +#include "../7zip/Common/DeclareArcs.h"
    1.16 +
    1.17 +FORCE_REF(struct CCRCTableInit, g_CRCTableInit)
    1.18 +
    1.19 +
    1.20 +// these don't seem to be necessary with my compiler,
    1.21 +// but they're here in case a different compiler more aggressively strips out unreferenced code
    1.22 +FORCE_REF(class CBZip2CrcTableInit, g_BZip2CrcTableInit)
    1.23 +namespace NCrypto { struct CAesTabInit; FORCE_REF(CAesTabInit, g_AesTabInit) }
    1.24 +namespace NBitl { struct CInverterTableInitializer; FORCE_REF(CInverterTableInitializer, g_InverterTableInitializer) }
    1.25 +namespace NCompress { namespace NRar3 { class CDistInit; FORCE_REF(CDistInit, g_DistInit) }}
    1.26 +namespace NArchive { namespace NLzh { class CCRCTableInit; FORCE_REF(CCRCTableInit, g_CRCTableInit) }}
    1.27 +namespace NArchive { namespace N7z { class SignatureInitializer; FORCE_REF(SignatureInitializer, g_SignatureInitializer) }}
    1.28 +namespace NArchive{ namespace NRar{ namespace NHeader{ class CMarkerInitializer; FORCE_REF(CMarkerInitializer, g_MarkerInitializer) }}}
    1.29 +namespace NArchive { namespace NZip { namespace NSignature{ class CMarkersInitializer; FORCE_REF(CMarkersInitializer, g_MarkerInitializer) }}}
    1.30 +
    1.31 +
    1.32 +#endif