Source code of Windows XP (NT5)
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.

68 lines
1.9 KiB

  1. ////////////////////////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Microsoft WMI OLE DB Provider
  4. // (C) Copyright 1999 Microsoft Corporation. All Rights Reserved.
  5. //
  6. // Assertion Routines
  7. //
  8. ////////////////////////////////////////////////////////////////////////////////////////////////////////
  9. #ifndef _ASSERTS_H_
  10. #define _ASSERTS_H_
  11. //====================================================================================
  12. // Global function prototypes -- helper stuff
  13. // The assert and trace macros below calls these.
  14. //====================================================================================
  15. void OLEDB_Assert(LPSTR expression, LPSTR filename, long linenum);
  16. void OLEDB_Trace(const char* format, ...);
  17. //====================================================================================
  18. // Debugging macros
  19. //
  20. // Ensure "DEBUG" is set if "_DEBUG" is set.
  21. //====================================================================================
  22. #ifdef _DEBUG
  23. # ifndef DEBUG
  24. # define DEBUG 1
  25. # endif
  26. #endif
  27. //====================================================================================
  28. // Ensure no previous versions of our macros.
  29. //====================================================================================
  30. #ifdef assert
  31. # undef assert
  32. #endif
  33. #ifdef Assert
  34. # undef Assert
  35. #endif
  36. #ifdef ASSERT
  37. # undef ASSERT
  38. #endif
  39. #ifdef TRACE
  40. # undef TRACE
  41. #endif
  42. #ifdef DEBUG
  43. # define assert(x) { if ( ! (x) ) OLEDB_Assert( #x, __FILE__, __LINE__ ); }
  44. # define Assert(x) assert(x)
  45. # define ASSERT(x) assert(x)
  46. # define VERIFY(x) assert(x)
  47. # define TRACE OLEDB_Trace
  48. # define DEBUGCODE(p) p
  49. #else // DEBUG
  50. # define assert(x) ((void)0)
  51. # define Assert(x) ((void)0)
  52. # define ASSERT(x) ((void)0)
  53. # define VERIFY(x) ((void)(x))
  54. # define TRACE OLEDB_Trace
  55. inline void OLEDB_Trace( const char *format, ... ) { /* do nothing */ }
  56. # define DEBUGCODE(p)
  57. #endif // DEBUG
  58. #endif