home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / XenonSource.exe / gamesystem / includes / gs_error.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-26  |  1.3 KB  |  66 lines

  1. //-------------------------------------------------------------
  2. //
  3. // Class:    gsCError
  4. //
  5. // Author:    John M Phillips
  6. //
  7. // Started:    12/03/00
  8. //
  9. // Base:    None
  10. //
  11. // Derived:    None
  12. //
  13. //-------------------------------------------------------------
  14.  
  15. #ifndef _INCLUDE_GS_ERROR_H
  16. #define _INCLUDE_GS_ERROR_H
  17.  
  18. #include "gs_object.h"
  19.  
  20. //-------------------------------------------------------------
  21. // Define our own version of assert
  22.  
  23. #ifdef _DEBUG
  24.  
  25. #define gsASSERT(exp) (void)( (exp) || (gsDoAssert(#exp, __FILE__, __LINE__), 0) )
  26.  
  27. void gsDoAssert(void *exp, void *file, unsigned line);
  28.  
  29. #else
  30.  
  31. #define gsASSERT(exp) ((void) 0)
  32.  
  33. #endif
  34.  
  35. //-------------------------------------------------------------
  36.  
  37. class gsCError : public gsCObject
  38. {
  39.     private:
  40.  
  41.  
  42.     public:
  43.         gsCError();
  44.         ~gsCError();
  45.  
  46.         static void _cdecl log(const char *format,...);
  47. };
  48.  
  49. //-------------------------------------------------------------
  50.  
  51. #ifdef gsENABLE_DEBUG_REPORT
  52. #define gsREPORT(s) gsCError::log("REPORT : %s",s)
  53. #else
  54. #define gsREPORT(s) ((void) 0)
  55. #endif
  56.  
  57. #ifdef gsENABLE_ERROR_LOG
  58. #define gsERROR(s) gsCError::log("ERROR : %s",s)
  59. #else
  60. #define gsERROR(s) ((void) 0)
  61. #endif
  62.  
  63. //-------------------------------------------------------------
  64.  
  65. #endif
  66.