Browse Source

Fix debug build

android-fixes
JusicP 3 years ago
parent
commit
de6f256299
  1. 2
      datamodel/dmattribute.cpp
  2. 12
      filesystem/packfile.cpp
  3. 2
      public/tier0/memdbgon.h
  4. 11
      wscript

2
datamodel/dmattribute.cpp

@ -2898,7 +2898,7 @@ void CDmaDecorator<T,B>::Init( CDmElement *pOwner, const char *pAttributeName, i @@ -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 );

12
filesystem/packfile.cpp

@ -879,10 +879,10 @@ int64 CZipPackFileHandle::AbsoluteBaseOffset() @@ -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 @@ -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 @@ -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 )

2
public/tier0/memdbgon.h

@ -39,7 +39,9 @@ @@ -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

@ -160,7 +160,6 @@ def define_platform(conf): @@ -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): @@ -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')

Loading…
Cancel
Save