err.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. //***************************************************************************
  2. //
  3. // err.cpp -- Error Handling routines
  4. //
  5. // MechCommander 2
  6. //
  7. //---------------------------------------------------------------------------//
  8. // Copyright (C) Microsoft Corporation. All rights reserved. //
  9. //===========================================================================//
  10. //--------------
  11. // Include Files
  12. #include <stdio.h>
  13. #include <gameos.hpp>
  14. //***************************************************************************
  15. // Error Handling routines
  16. //***************************************************************************
  17. void Fatal (long errCode, char* errMessage) {
  18. char msg[512];
  19. sprintf(msg, " [FATAL %d] %s ", errCode, errMessage);
  20. STOP((msg));
  21. }
  22. //---------------------------------------------------------------------------
  23. void Assert (bool test, long errCode, char* errMessage) {
  24. if (!test) {
  25. char msg[512];
  26. sprintf(msg, " [ASSERT %d] %s ", errCode, errMessage);
  27. STOP((msg));
  28. }
  29. }
  30. //***************************************************************************