YARP
Yet Another Robot Platform
PlatformSignal.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
9 #ifndef YARP_OS_IMPL_PLATFORMSIGNAL_H
10 #define YARP_OS_IMPL_PLATFORMSIGNAL_H
11 
12 #include <yarp/conf/system.h>
13 #ifdef YARP_HAS_ACE
14 # include <ace/OS_NS_signal.h>
15 // In one the ACE headers there is a definition of "main" for WIN32
16 # ifdef main
17 # undef main
18 # endif
19 #elif defined(YARP_HAS_SIGNAL_H)
20 # include <signal.h>
21 #elif defined(YARP_HAS_SYS_SIGNAL_H)
22 # include <sys/signal.h>
23 #endif
24 #if defined(YARP_HAS_CSIGNAL)
25 # include <csignal>
26 #endif
27 
28 namespace yarp {
29 namespace os {
30 namespace impl {
31 
32 #if defined(YARP_HAS_ACE)
33  using ACE_OS::sigemptyset;
34  using ACE_OS::sigfillset;
35  using ACE_OS::sigaction;
36  using ACE_OS::kill;
37 # if defined(YARP_HAS_CSIGNAL)
38  // Prefer std::signal over ::signal
39  using std::signal;
40  using std::raise;
41 # else
42  using ::signal;
43  using ::raise;
44 # endif
45 #else
46 #if defined(__APPLE__) && defined(sigfillset)
47 #undef sigfillset
48 #endif
49  using ::sigemptyset;
50  using ::sigfillset;
51  using ::sigaction;
52  using ::kill;
53 # if defined(YARP_HAS_CSIGNAL)
54  // Prefer std::signal over ::signal
55  using std::signal;
56  using std::raise;
57 # else
58  using ::signal;
59  using ::raise;
60 # endif
61 #endif
62 
63 } // namespace impl
64 } // namespace os
65 } // namespace yarp
66 
67 
68 #endif // YARP_OS_IMPL_PLATFORMSIGNAL_H
The main, catch-all namespace for YARP.
Definition: numeric.h:47