YARP  2.3.70.2
Yet Another Robot Platform
PlatformSignal.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 iCub Facility, Istituto Italiano di Tecnologia (IIT)
3  * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT
4  */
5 
6 #ifndef YARP_OS_IMPL_PLATFORMSIGNAL_H
7 #define YARP_OS_IMPL_PLATFORMSIGNAL_H
8 
9 #include <yarp/conf/system.h>
10 #ifdef YARP_HAS_ACE
11 # include <ace/OS_NS_signal.h>
12 #elif defined(YARP_HAS_SIGNAL_H)
13 # include <signal.h>
14 #elif defined(YARP_HAS_SYS_SIGNAL_H)
15 # include <sys/signal.h>
16 #endif
17 #if defined(YARP_HAS_CSIGNAL)
18 # include <csignal>
19 #endif
20 
21 namespace yarp {
22 namespace os {
23 namespace impl {
24 
25 #if defined(YARP_HAS_ACE)
26  using ACE_OS::sigemptyset;
27  using ACE_OS::sigfillset;
28  using ACE_OS::sigaction;
29  using ACE_OS::kill;
30  // std::signal is broken for Visual Studio 12 2013
31  // (Fixed in Visual studio 14 2015)
32 # if defined(_MSC_VER) && _MSC_VER <= 1800
33  using ACE_OS::signal;
34  using ACE_OS::raise;
35 # elif defined(YARP_HAS_CSIGNAL)
36  // Prefer std::signal over ::signal
37  using std::signal;
38  using std::raise;
39 # else
41  using ::raise;
42 # endif
43 #else
44 #if defined(__APPLE__) && defined(sigfillset)
45 #undef sigfillset
46 #endif
47  using ::sigemptyset;
48  using ::sigfillset;
49  using ::sigaction;
50  using ::kill;
51 # if defined(YARP_HAS_CSIGNAL)
52  // Prefer std::signal over ::signal
53  using std::signal;
54  using std::raise;
55 # else
57  using ::raise;
58 # endif
59 #endif
60 
61 } // namespace impl
62 } // namespace os
63 } // namespace yarp
64 
65 
66 #endif // YARP_OS_IMPL_PLATFORMSIGNAL_H
The main, catch-all namespace for YARP.
YarpSignalHandler signal(int signum, YarpSignalHandler sighandler)
Portable wrapper for the signal() function.
Definition: Os.cpp:26