1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2025-09-19 20:16:10 +08:00

Imported tier1 and mathlib code from L4D2 SDK.

This commit is contained in:
Scott Ehlert
2012-05-21 02:48:36 -05:00
parent 5d4df73a21
commit afaa180bbc
62 changed files with 30858 additions and 0 deletions

41
tier1/rangecheckedvar.cpp Normal file
View File

@ -0,0 +1,41 @@
//========= Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
//=============================================================================//
#include "rangecheckedvar.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
bool g_bDoRangeChecks = true;
static int g_nDisables = 0;
CDisableRangeChecks::CDisableRangeChecks()
{
if ( !ThreadInMainThread() )
return;
g_nDisables++;
g_bDoRangeChecks = false;
}
CDisableRangeChecks::~CDisableRangeChecks()
{
if ( !ThreadInMainThread() )
return;
Assert( g_nDisables > 0 );
--g_nDisables;
if ( g_nDisables == 0 )
{
g_bDoRangeChecks = true;
}
}