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.

60 lines
1.4 KiB

  1. /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. debug.cxx
  5. Abstract:
  6. assert and debugging routines
  7. Notes:
  8. Author:
  9. mzoran Feb-25-2000 Created.
  10. Notes:
  11. ----------------------------------------------------------------------------*/
  12. #if defined(MIDL_ENABLE_ASSERTS)
  13. #include "stdio.h"
  14. #include "common.hxx"
  15. #include "errors.hxx"
  16. #include "windows.h"
  17. #pragma warning(disable: 4702) // unreachable code
  18. int DisplayAssertMsg(char *pFileName, int LineNumber, char *pExpr )
  19. {
  20. printf( "\nmidl : error MIDL%d : internal compiler problem -",
  21. I_ERR_UNEXPECTED_INTERNAL_PROBLEM );
  22. printf( " See documentation for suggestions on how to find a workaround.\n" );
  23. printf( "midl: Assertion failed: %s, file %s, line %d\n", pExpr, pFileName, LineNumber );
  24. #if DBG
  25. if ( IsDebuggerPresent() )
  26. DebugBreak();
  27. #endif
  28. exit( I_ERR_UNEXPECTED_INTERNAL_PROBLEM );
  29. // We return int because this fuction is called from the ternary operator
  30. // but it actually never returns because of the exit above. Because it
  31. // returns int we can't use __declspec(noreturn). Warnings about this
  32. // unreachable return statement are supressed via pragma above.
  33. return I_ERR_UNEXPECTED_INTERNAL_PROBLEM;
  34. }
  35. #endif