Refactor SrcLoc and SrcSpan
[ghc-hetmet.git] / rts / win32 / seh_excn.h
index 410d430..8829e84 100644 (file)
@@ -1,5 +1,6 @@
-#ifndef __SEH_EXCN_H__
-#define __SEH_EXCN_H__
+#ifndef WIN32_SEH_EXCN_H
+#define WIN32_SEH_EXCN_H
+
 #include <stdio.h>
 #include <stdlib.h>
 
  *
  * seh_excn provides two macros, BEGIN_CATCH and END_CATCH, which
  * will catch such exceptions in the code they bracket and die by
- * printing a message and calling exit(1).
+ * printing a message and calling stg_exit(1).
  */
-#define ON_DIV_ZERO fprintf(stdout,"divide by zero\n"); fflush(stdout);exit(1)
-#define ON_STACK_OVERFLOW fprintf(stdout,"C stack overflow in generated code\n"); fflush(stdout); exit(1)
-#define ON_SIGSEGV fprintf(stdout,"Segmentation fault/access violation in generated code\n"); fflush(stdout); exit(1)
+#define ON_DIV_ZERO fprintf(stdout,"divide by zero\n"); fflush(stdout);stg_exit(1)
+#define ON_STACK_OVERFLOW fprintf(stdout,"C stack overflow in generated code\n"); fflush(stdout); stg_exit(1)
+#define ON_SIGSEGV fprintf(stdout,"Segmentation fault/access violation in generated code\n"); fflush(stdout); stg_exit(1)
 
 #if defined(__MINGW32__)
 extern jmp_buf seh_unwind_to;
@@ -84,8 +85,8 @@ catchDivZero(struct _EXCEPTION_RECORD*,
    } \
   }
 #else
-#error Don't know what sort of Windows system this is
+#error Cannot determine what sort of Windows system this is
 #endif
 
-#endif /* __SEH_EXCN_H__ */
+#endif /* WIN32_SEH_EXCN_H */