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.

40 lines
1.0 KiB

  1. /*==========================================================================
  2. *
  3. * Copyright (C) 1996 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: macros.c
  6. * Content: debugging macros
  7. *@@BEGIN_MSINTERNAL
  8. * History:
  9. * Date By Reason
  10. * ==== == ======
  11. * 6/10/96 kipo created it
  12. *@@END_MSINTERNAL
  13. ***************************************************************************/
  14. #include "dpf.h"
  15. #define FAILMSG(condition) \
  16. if ((condition)) { \
  17. DPF(0, DPF_MODNAME " line %d : Failed because " #condition "", __LINE__); \
  18. }
  19. #define FAILERR(err, label) \
  20. if ((err)) { \
  21. DPF(0, DPF_MODNAME " line %d : Error = %d", __LINE__, (err)); \
  22. goto label; \
  23. }
  24. #define FAILIF(condition, label) \
  25. if ((condition)) { \
  26. DPF(0, DPF_MODNAME " line %d : Failed because " #condition "", __LINE__); \
  27. goto label; \
  28. }
  29. #define FAILWITHACTION(condition, action, label) \
  30. if ((condition)) { \
  31. DPF(0, DPF_MODNAME " line %d : Failed because " #condition "", __LINE__); \
  32. { action; } \
  33. goto label; \
  34. }