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.

35 lines
664 B

  1. /***
  2. *assert.h - define the assert macro
  3. *
  4. * Copyright (c) 1985-1988, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * Defines the assert(exp) macro.
  8. * [ANSI/System V]
  9. *
  10. *******************************************************************************/
  11. #ifndef _ASSERT_DEFINED
  12. #ifndef NDEBUG
  13. static char _assertstring[] = "Assertion failed: %s, file %s, line %d\n";
  14. #define assert(exp) { \
  15. if (!(exp)) { \
  16. fprintf(stderr, _assertstring, #exp, __FILE__, __LINE__); \
  17. fflush(stderr); \
  18. abort(); \
  19. } \
  20. }
  21. #else
  22. #define assert(exp)
  23. #endif /* NDEBUG */
  24. #define _ASSERT_DEFINED
  25. #endif /* _ASSERT_DEFINED */