home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 Mobile / Chip_Mobile_2001.iso / palm / business / printcar / printcar.exe / src / Util / Assert.cc < prev    next >
C/C++ Source or Header  |  2000-06-03  |  840b  |  42 lines

  1. //
  2. //  $Id: Assert.cc,v 1.1.1.1 2000/06/02 22:23:02 sergey Exp $
  3. //
  4.  
  5. #include <Pilot.h>
  6. #include <stdarg.h>
  7. #include <stdio.h>
  8. #include "Assert.h"
  9.  
  10.  
  11. #ifdef DEBUG
  12.  
  13. namespace Util
  14. {
  15.     void DebugMessage(const char* file, int line, const char* format, ...)
  16.     {
  17.         va_list args;
  18.         char buffer[256];
  19.  
  20.         va_start(args, format);
  21.         StrVPrintF(buffer, format, args);
  22.         va_end(args);
  23.  
  24.         ErrDisplayFileLineMsg(file, line, buffer);
  25.     }
  26.  
  27.     void DebugPrintf(const char* format, ...)
  28.     {
  29.         va_list args;
  30.         char buffer[256];
  31.  
  32.         va_start(args, format);
  33.         StrVPrintF(buffer, format, args);
  34.         va_end(args);
  35.  
  36.         for (int i = 0, len = StrLen(buffer); i < len; ++i)
  37.             putchar(buffer[i]);
  38.     }
  39. } // namespace Util
  40.  
  41. #endif  // DEBUG
  42.