1/* $Id: CoinSignal.hpp 1372 2011-01-03 23:31:00Z lou $ */
2// Copyright (C) 2003, International Business Machines
3// Corporation and others. All Rights Reserved.
4// This code is licensed under the terms of the Eclipse Public License (EPL).
5
6#ifndef _CoinSignal_hpp
7#define _CoinSignal_hpp
8
9// This file is fully docified.
10// There's nothing to docify...
11
12//#############################################################################
13
14#include <csignal>
15
16//#############################################################################
17
18#if defined(_MSC_VER)
19 typedef void (__cdecl *CoinSighandler_t) (int);
20# define CoinSighandler_t_defined
21#endif
22
23//-----------------------------------------------------------------------------
24
25#if (defined(__GNUC__) && defined(__linux__))
26 typedef sighandler_t CoinSighandler_t;
27# define CoinSighandler_t_defined
28#endif
29
30//-----------------------------------------------------------------------------
31
32#if defined(__CYGWIN__) && defined(__GNUC__)
33 typedef decltype(SIG_DFL) CoinSighandler_t;
34# define CoinSighandler_t_defined
35#endif
36
37//-----------------------------------------------------------------------------
38
39#if defined(__MINGW32__) && defined(__GNUC__)
40 typedef decltype(SIG_DFL) CoinSighandler_t;
41# define CoinSighandler_t_defined
42#endif
43
44//-----------------------------------------------------------------------------
45
46#if defined(__FreeBSD__) && defined(__GNUC__)
47 typedef decltype(SIG_DFL) CoinSighandler_t;
48# define CoinSighandler_t_defined
49#endif
50
51//-----------------------------------------------------------------------------
52
53#if defined(__NetBSD__) && defined(__GNUC__)
54 typedef decltype(SIG_DFL) CoinSighandler_t;
55# define CoinSighandler_t_defined
56#endif
57
58//-----------------------------------------------------------------------------
59
60#if defined(_AIX)
61# if defined(__GNUC__)
62 typedef decltype(SIG_DFL) CoinSighandler_t;
63# define CoinSighandler_t_defined
64# endif
65#endif
66
67//-----------------------------------------------------------------------------
68
69#if defined (__hpux)
70# define CoinSighandler_t_defined
71# if defined(__GNUC__)
72 typedef decltype(SIG_DFL) CoinSighandler_t;
73# else
74 extern "C" {
75 typedef void (*CoinSighandler_t) (int);
76 }
77# endif
78#endif
79
80//-----------------------------------------------------------------------------
81
82#if defined(__sun)
83# if defined(__SUNPRO_CC)
84# include <signal.h>
85 extern "C" {
86 typedef void (*CoinSighandler_t) (int);
87 }
88# define CoinSighandler_t_defined
89# endif
90# if defined(__GNUC__)
91 typedef decltype(SIG_DFL) CoinSighandler_t;
92# define CoinSighandler_t_defined
93# endif
94#endif
95
96//-----------------------------------------------------------------------------
97
98#if defined(__MACH__) && defined(__GNUC__)
99#if defined(__clang__)
100 typedef void(*CoinSighandler_t)(int);
101#else
102 typedef decltype(SIG_DFL) CoinSighandler_t;
103#endif
104#define CoinSighandler_t_defined
105#endif
106
107//#############################################################################
108
109#ifndef CoinSighandler_t_defined
110#warning("OS and/or compiler is not recognized. Defaulting to:");
111#warning("extern \"C\" {")
112#warning(" typedef void (*CoinSighandler_t) (int);")
113#warning("}")
114 extern "C" {
115 typedef void (*CoinSighandler_t) (int);
116 }
117#endif
118
119//#############################################################################
120
121#endif
122