YARP
Yet Another Robot Platform
PlatformSignal.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 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::kill;
34 using ACE_OS::sigaction;
35 using ACE_OS::sigemptyset;
36 using ACE_OS::sigfillset;
37 # if defined(YARP_HAS_CSIGNAL)
38 // Prefer std::signal over ::signal
39 using std::raise;
40 using std::signal;
41 # else
42 using ::raise;
43 using ::signal;
44 # endif
45 #else
46 # if defined(__APPLE__) && defined(sigfillset)
47 # undef sigfillset
48 # endif
49 using ::kill;
50 using ::sigaction;
51 using ::sigemptyset;
52 using ::sigfillset;
53 # if defined(YARP_HAS_CSIGNAL)
54 // Prefer std::signal over ::signal
55 using std::raise;
56 using std::signal;
57 # else
58 using ::raise;
59 using ::signal;
60 # endif
61 #endif
62 
63 } // namespace impl
64 } // namespace os
65 } // namespace yarp
66 
67 
68 #endif // YARP_OS_IMPL_PLATFORMSIGNAL_H
system.h
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18