Skip to content

Commit 070579a

Browse files
committed
M18-7-1: Address signal.h compiler compat
Better reflect how real compilers implement csignal.
1 parent 353de74 commit 070579a

File tree

4 files changed

+17
-12
lines changed

4 files changed

+17
-12
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
| test.cpp:7:3:7:13 | call to signal | Use of <csignal> function 'std::signal'. |
2-
| test.cpp:8:3:8:12 | call to raise | Use of <csignal> function 'std::raise'. |
1+
| test.cpp:7:3:7:13 | call to signal | Use of <csignal> function 'signal'. |
2+
| test.cpp:8:3:8:12 | call to raise | Use of <csignal> function 'raise'. |
33
| test.cpp:11:3:11:8 | call to signal | Use of <csignal> function 'signal'. |
44
| test.cpp:12:3:12:7 | call to raise | Use of <csignal> function 'raise'. |
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
| test.cpp:6:8:6:19 | type mention | Use of <csignal> type 'std::sig_atomic_t'. |
1+
| test.cpp:6:8:6:19 | type mention | Use of <csignal> type 'sig_atomic_t'. |
22
| test.cpp:10:3:10:14 | type mention | Use of <csignal> type 'sig_atomic_t'. |

cpp/common/test/includes/standard-library/csignal

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,10 @@
1010
#define SIG_IGN 7
1111
#define SIG_ERR 8
1212

13-
namespace std {
14-
typedef int sig_atomic_t;
15-
void (*signal(int, void (*func)(int)))(int);
16-
int raise(int sig);
17-
} // namespace std
13+
#include <signal.h>
1814

19-
// global namespace
20-
typedef int sig_atomic_t;
21-
void (*signal(int, void (*func)(int)))(int);
22-
int raise(int);
15+
namespace std {
16+
using ::raise;
17+
using ::sig_atomic_t;
18+
using ::signal;
19+
} // namespace std
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#ifndef _GHLIBCPP_SIGNAL
2+
#define _GHLIBCPP_SIGNAL
3+
4+
typedef int sig_atomic_t;
5+
void (*signal(int, void (*func)(int)))(int);
6+
int raise(int);
7+
8+
#endif // _GHLIBCPP_SIGNAL

0 commit comments

Comments
 (0)