From 2b7ba5b4ef0d2fc86adf872d37ebfc9ca4249e2f Mon Sep 17 00:00:00 2001 From: Nicholas Hastings Date: Sat, 15 Apr 2017 10:06:20 -0400 Subject: [PATCH] Remove Error funcs that no longer exit. Add compat shim. --- public/tier0/dbg.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/public/tier0/dbg.h b/public/tier0/dbg.h index a8f910c0..fe25e12e 100644 --- a/public/tier0/dbg.h +++ b/public/tier0/dbg.h @@ -251,8 +251,22 @@ DECLARE_LOGGING_CHANNEL( LOG_DEVELOPER_VERBOSE ); PLATFORM_INTERFACE void Msg( const tchar* pMsg, ... ); PLATFORM_INTERFACE void Warning( const tchar *pMsg, ... ) FMTFUNCTION( 1, 2 ); PLATFORM_INTERFACE void Warning_SpewCallStack( int iMaxCallStackLength, const tchar *pMsg, ... ) FMTFUNCTION( 2, 3 ); -PLATFORM_INTERFACE void Error( const tchar *pMsg, ... ) FMTFUNCTION( 1, 2 ); -PLATFORM_INTERFACE void Error_SpewCallStack( int iMaxCallStackLength, const tchar *pMsg, ... ) FMTFUNCTION( 2, 3 ); + +// This is gone in Source2. Provide helper to roughyl mimic Source1 behavior +inline void Error( const tchar *pMsg, ... ) FMTFUNCTION( 1, 2 ) +{ + char szBuf[256]; + va_list arg_ptr; + + va_start(arg_ptr, pMsg); + vsnprintf(szBuf, sizeof(szBuf)-1, pMsg, arg_ptr); + va_end(arg_ptr); + + szBuf[sizeof(szBuf)-1] = 0; + + Msg("%s", szBuf); + Plat_ExitProcess(1); +} // @TODO: these callstack spew functions are currently disabled in the new logging system. Need to add support for these if desired. PLATFORM_INTERFACE void _Warning_AlwaysSpewCallStack_Enable( bool bEnable );