Skip to content

Commit 20e25d1

Browse files
aitapMichaelChirico
andcommitted
utils.c: include <signal.h> for siginfo_t (#7517)
* utils.c: include <signal.h> for siginfo_t POSIX says: > The <signal.h> header shall define the siginfo_t type as a structure So <sys/wait.h> is not enough to see the definition (not just a forward declaration) of siginfo_t. * NEWS entry * Amend NEWS * more robustly define _POSIX_C_SOURCE (h/t Hugh) * tidy up NEWS * -D_POSIX_C_SOURCE=200809L in gitlab CI job for regression test * revert gitlab-ci change --------- Co-authored-by: Michael Chirico <[email protected]> Co-authored-by: Michael Chirico <[email protected]>
1 parent 0125d49 commit 20e25d1

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
1. Removed use of non-API `ATTRIB`, `SET_ATTRIB`, and `findVar` [#6180](https://github.com/Rdatatable/data.table/issues/6180). Thanks @aitap for the continued assiduous work here, and @MichaelChirico for the easy fix to replace `findVar` with `R_getVar`.
1010

11+
7. Fixed compilation failure like "error: unknown type name 'siginfo_t'" in v1.18.0 in some strict environments, e.g., FreeBSD, where the header file declaring the POSIX function `waitid` does not transitively include the header file defining the `siginfo_t` type, [#7516](https://github.com/rdatatable/data.table/issues/7516). Thanks to @jszhao for the report and @aitap for the fix.
12+
1113
### Notes
1214

1315
1. {data.table} now depends on R 3.5.0 (2018).

src/utils.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#ifndef _WIN32
2-
# include <sys/wait.h>
2+
# if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200809L
3+
# undef _POSIX_C_SOURCE
4+
# define _POSIX_C_SOURCE 200809L // required for POSIX (not standard C) features in is_direct_child e.g. 'siginfo_t'
5+
# endif
6+
# include <signal.h> // siginfo_t
7+
# include <sys/wait.h> // waitid
38
#endif
49

510
#include "data.table.h"

0 commit comments

Comments
 (0)