Fix debug build

This commit is contained in:
JusicP 2021-08-24 20:26:53 +03:00
parent 2a5b5060b4
commit de6f256299
4 changed files with 18 additions and 9 deletions

View File

@ -2898,7 +2898,7 @@ void CDmaDecorator<T,B>::Init( CDmElement *pOwner, const char *pAttributeName, i
{
Assert( pOwner );
this->m_pAttribute = pOwner->AddExternalAttribute( pAttributeName, CDmAttributeInfo<CUtlVector<T> >::AttributeType(), &Value() );
Assert( m_pAttribute );
Assert( this->m_pAttribute );
if ( nFlags )
{
this->m_pAttribute->AddFlag( nFlags );

View File

@ -879,10 +879,10 @@ int64 CZipPackFileHandle::AbsoluteBaseOffset()
return m_pOwner->GetPackFileBaseOffset() + m_nBase;
}
#if defined( _DEBUG ) && !defined( OSX )
#if defined( _DEBUG ) && !defined( OSX ) && !defined( ANDROID )
#include <atomic>
static std::atomic<int> sLZMAPackFileHandles( 0 );
#endif // defined( _DEBUG ) && !defined( OSX )
#endif // defined( _DEBUG ) && !defined( OSX ) && !defined( ANDROID )
CLZMAZipPackFileHandle::CLZMAZipPackFileHandle( CZipPackFile* pOwner, int64 nBase, unsigned int nOriginalSize, unsigned int nCompressedSize,
unsigned int nIndex, unsigned int nFilePointer )
@ -892,7 +892,7 @@ CLZMAZipPackFileHandle::CLZMAZipPackFileHandle( CZipPackFile* pOwner, int64 nBas
m_pLZMAStream( NULL ), m_nSeekPosition( 0 ), m_nOriginalSize( nOriginalSize )
{
Reset();
#if defined( _DEBUG ) && !defined( OSX )
#if defined( _DEBUG ) && !defined( OSX ) && !defined( ANDROID )
if ( ++sLZMAPackFileHandles == PACKFILE_COMPRESSED_FILE_HANDLES_WARNING )
{
// By my count a live filehandle is currently around 270k, mostly due to the LZMA dictionary (256k) with the
@ -901,17 +901,17 @@ CLZMAZipPackFileHandle::CLZMAZipPackFileHandle( CZipPackFile* pOwner, int64 nBas
"These carry large buffers around, and can cause high memory usage\n",
PACKFILE_COMPRESSED_FILE_HANDLES_WARNING );
}
#endif // defined( _DEBUG ) && !defined( OSX )
#endif // defined( _DEBUG ) && !defined( OSX ) && !defined( ANDROID )
}
CLZMAZipPackFileHandle::~CLZMAZipPackFileHandle()
{
delete m_pLZMAStream;
m_pLZMAStream = NULL;
#if defined( _DEBUG ) && !defined( OSX )
#if defined( _DEBUG ) && !defined( OSX ) && !defined( ANDROID )
sLZMAPackFileHandles--;
Assert( sLZMAPackFileHandles >= 0 );
#endif // defined( _DEBUG ) && !defined( OSX )
#endif // defined( _DEBUG ) && !defined( OSX ) && !defined( ANDROID )
}
int CLZMAZipPackFileHandle::Read( void* pBuffer, int nDestSize, int nBytes )

View File

@ -39,7 +39,9 @@
#define _NORMAL_BLOCK 1
#include <cstddef>
#ifndef ANDROID
#include <glob.h>
#endif
#include <new>
#include <sys/types.h>
#if !defined( DID_THE_OPERATOR_NEW )

11
wscript
View File

@ -160,7 +160,6 @@ def define_platform(conf):
'LINUX=1', '_LINUX=1',
'POSIX=1', '_POSIX=1',
'GNUC',
'NDEBUG',
'NO_HOOK_MALLOC',
'_DLL_EXT=.so'
])
@ -171,11 +170,19 @@ def define_platform(conf):
'LINUX=1', '_LINUX=1',
'POSIX=1', '_POSIX=1',
'GNUC',
'NDEBUG',
'NO_HOOK_MALLOC',
'_DLL_EXT=.so'
])
if conf.options.BUILD_TYPE == 'debug':
conf.env.append_unique('DEFINES', [
'DEBUG', '_DEBUG'
])
else:
conf.env.append_unique('DEFINES', [
'NDEBUG'
])
def options(opt):
grp = opt.add_option_group('Common options')