Building GHC with hadrian on FreeBSD
[ghc.git] / rts / Excn.h
1 /* -----------------------------------------------------------------------------
2 *
3 * (c) The GHC Team 1998-2000
4 *
5 * Hides indirection for EH handlers for different platforms
6 *
7 * ---------------------------------------------------------------------------*/
8
9 #pragma once
10
11 #include "ghcconfig.h"
12
13 // On windows Excn provides two macros
14 // BEGIN_WINDOWS_VEH_HANDLER and END_WINDOWS_VEH_HANDLER, which
15 // will catch such exceptions in the entire process and die by
16 // printing a message and calling stg_exit(1).
17 //
18 // For other operating systems an empty macro is defined so
19 // that no #ifdefs are needed around the usage of these macros.
20
21
22 #if defined(mingw32_HOST_OS)
23 #include "win32/veh_excn.h"
24
25 #define BEGIN_WINDOWS_VEH_HANDLER __register_hs_exception_handler();
26 #define END_WINDOWS_VEH_HANDLER __unregister_hs_exception_handler();
27 #else
28 #define BEGIN_WINDOWS_VEH_HANDLER
29 #define END_WINDOWS_VEH_HANDLER
30 #endif /* mingw32_HOST_OS */