summaryrefslogtreecommitdiff
path: root/rts/Excn.h
blob: d32c145c505e658dd600eb4d7d6a720f85c4ff2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* -----------------------------------------------------------------------------
*
* (c) The GHC Team 1998-2000
*
* Hides indirection for EH handlers for different platforms
*
* ---------------------------------------------------------------------------*/

#pragma once

#include "ghcconfig.h"

// On windows Excn provides two macros
// BEGIN_WINDOWS_VEH_HANDLER  and END_WINDOWS_VEH_HANDLER, which
// will catch such exceptions in the entire process and die by
// printing a message and calling stg_exit(1).
//
// For other operating systems an empty macro is defined so
// that no #ifdefs are needed around the usage of these macros.


#if defined(mingw32_HOST_OS)
#include "win32/veh_excn.h"

#define BEGIN_WINDOWS_VEH_HANDLER __register_hs_exception_handler();
#define END_WINDOWS_VEH_HANDLER __unregister_hs_exception_handler();
#else
#define BEGIN_WINDOWS_VEH_HANDLER
#define END_WINDOWS_VEH_HANDLER
#endif /* mingw32_HOST_OS */