Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.1 KiB

  1. //====== Copyright �, Valve Corporation, All rights reserved. =======
  2. //
  3. // Purpose: schemainitutils: Helpful macros when initing stuff that you'll
  4. // want to record multiple errors from
  5. //
  6. //=============================================================================
  7. #ifndef SCHEMAINITUTILS_H
  8. #define SCHEMAINITUTILS_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. // used for initialization functions. Adds an error message if we're recording
  13. // them or returns false if we're not
  14. #define SCHEMA_INIT_CHECK( expr, pchErrorMsg ) \
  15. if ( !( expr ) ) \
  16. { \
  17. if ( NULL == ( pVecErrors ) ) \
  18. { \
  19. AssertMsg( expr, pchErrorMsg.Access() ); \
  20. return false; \
  21. } \
  22. else \
  23. { \
  24. pVecErrors->AddToTail( CUtlString( pchErrorMsg.Access() ) ); \
  25. } \
  26. }
  27. #define SCHEMA_INIT_SUCCESS( ) \
  28. ( NULL == pVecErrors ) || ( 0 == pVecErrors->Count() )
  29. #define SCHEMA_INIT_SUBSTEP( expr ) \
  30. if ( ( false == ( expr ) ) && ( NULL == ( pVecErrors ) ) ) \
  31. return false;
  32. #endif // SCHEMAINITUTILS_H