summaryrefslogtreecommitdiff
path: root/rts/Excn.h
blob: b3932340219c29c924875526f39809da61dd7f76 (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
31
32
33
34
/* -----------------------------------------------------------------------------
*
* (c) The GHC Team 1998-2000
*
* Hides indirection for EH handlers for different platforms
*
* ---------------------------------------------------------------------------*/

#ifndef EXCN_H
#define EXCN_H

#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 */

#endif /* EXCN_H */