Posted to tcl by patthoyts at Sat Mar 08 11:10:26 GMT 2008view raw

  1. package require critcl
  2.  
  3. namespace eval win32 {
  4. critcl::ccode {
  5. #define STRICT
  6. #define WIN32_LEAN_AND_MEAN
  7. #include <windows.h>
  8. #ifdef _MSC_VER
  9. #include <crtdbg.h>
  10. #endif
  11.  
  12. # Halt the process and enter the debugger.
  13. critcl::cproc Debug {} void {
  14. #ifdef _MSC_VER
  15. #ifdef _DEBUG
  16. _ASSERTE(FALSE); /* this is a kinder way to halt */
  17. #else
  18. __asm {
  19. int 3;
  20. };
  21. #endif /* _DEBUG */
  22. #else /* ! _MSC_VER */
  23. /* __asm__ __volatile__ ("int 3" "\n"); */
  24. #endif /* _MSC_VER */
  25. }
  26. }