Leaked source code of windows server 2003
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.

44 lines
1.3 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows Media
  4. //
  5. // Copyright (C) Microsoft Corporation, 1999 - 1999
  6. //
  7. // File: Util.h
  8. //
  9. //--------------------------------------------------------------------------
  10. #ifndef _UTIL_H_
  11. #define _UTIL_H_
  12. // Error handling
  13. //
  14. #define ExitOnTrue( f ) if( f ) goto lExit;
  15. #define ExitOnFalse( f ) if( !(f) ) goto lExit;
  16. #define ExitOnNull( x ) if( (x) == NULL ) goto lExit;
  17. #define ExitOnFail( hr ) if( FAILED(hr) ) goto lExit;
  18. #define FailOnTrue( f ) if( f ) goto lErr;
  19. #define FailOnFalse( f ) if( !(f) ) goto lErr;
  20. #define FailOnNull( x ) if( (x) == NULL ) goto lErr;
  21. #define FailOnFail( hr ) if( FAILED(hr) ) goto lErr;
  22. // String macros
  23. //
  24. #define AddPath( sz, szAdd ) { if(sz[lstrlen(sz)-1] != '\\') lstrcat(sz, "\\" ); lstrcat(sz,szAdd); }
  25. // Misc constants
  26. //
  27. #define KB ( 1024 )
  28. #define MAX_WSPRINTF_BUF ( 1024 )
  29. // Misc macros
  30. //
  31. #define Reference(x) if( x ) {INT i=0;}
  32. // OutputDebugString functions
  33. //
  34. #define ODS(sz) OutputDebugString(sz)
  35. #define ODS_1(t,v1) { char sz[256]; wsprintf(sz,t,v1); ODS(sz); }
  36. #endif // _UTIL_H_