scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit 7763360a5dd368f108646228a485a9bc756897e0
parent 1313699dc3e6c95ef8713c7d56d4fdc4d1d7cecb
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Sat,  2 Oct 2021 22:16:41 +0200

libc: Fix build in bsd systems

After the commit 383f380a the other BSD systems didn't compile
because the new sigaction.h file was not present on them.
This commit uses the same header that the one used in
OpenBSD that should work but it could not be tested correctly.
At least the compilation is fixed again.

Diffstat:
Ainclude/bits/darwin/amd64/arch/sigaction.h | 15+++++++++++++++
Minclude/bits/darwin/sys.h | 10++--------
Ainclude/bits/dragonfly/amd64/arch/sigaction.h | 15+++++++++++++++
Minclude/bits/dragonfly/sys.h | 10++--------
Ainclude/bits/netbsd/amd64/arch/sigaction.h | 15+++++++++++++++
Rinclude/bits/netbsd/amd64/stdint.h -> include/bits/netbsd/amd64/arch/stdint.h | 0
Rinclude/bits/netbsd/amd64/time.h -> include/bits/netbsd/amd64/arch/time.h | 0
Minclude/bits/netbsd/sys.h | 10++--------
Minclude/bits/openbsd/sys.h | 4++--
9 files changed, 53 insertions(+), 26 deletions(-)

diff --git a/include/bits/darwin/amd64/arch/sigaction.h b/include/bits/darwin/amd64/arch/sigaction.h @@ -0,0 +1,15 @@ +typedef unsigned int sigset_t; +typedef struct siginfo siginfo_t; + +struct sigaction { + union { + void (*__sa_handler)(int); + void (*__sa_sigaction)(int, siginfo_t *, void *); + } __sigaction_u; + + sigset_t sa_mask; + int sa_flags; +}; + +#define sa_handler __sigaction_u.__sa_handler +#define sa_sigaction __sigaction_u.__sa_sigaction diff --git a/include/bits/darwin/sys.h b/include/bits/darwin/sys.h @@ -12,12 +12,6 @@ typedef int pid_t; -struct sigaction { - void (*sa_handler)(int); - int sa_mask; - int sa_flags; -}; - extern pid_t _getpid(void); -extern int _kill(pid_t pid, int signum); -extern int _sigaction(int sig, struct sigaction *new, struct sigaction *old); +extern int _kill(pid_t, int); +extern int _sigaction(int, struct sigaction *, struct sigaction *); diff --git a/include/bits/dragonfly/amd64/arch/sigaction.h b/include/bits/dragonfly/amd64/arch/sigaction.h @@ -0,0 +1,15 @@ +typedef unsigned int sigset_t; +typedef struct siginfo siginfo_t; + +struct sigaction { + union { + void (*__sa_handler)(int); + void (*__sa_sigaction)(int, siginfo_t *, void *); + } __sigaction_u; + + sigset_t sa_mask; + int sa_flags; +}; + +#define sa_handler __sigaction_u.__sa_handler +#define sa_sigaction __sigaction_u.__sa_sigaction diff --git a/include/bits/dragonfly/sys.h b/include/bits/dragonfly/sys.h @@ -12,12 +12,6 @@ typedef int pid_t; -struct sigaction { - void (*sa_handler)(int); - char sa_mask[8]; - int sa_flags; -}; - extern pid_t _getpid(void); -extern int _kill(pid_t pid, int signum); -extern int _sigaction(int sig, struct sigaction *new, struct sigaction *old); +extern int _kill(pid_t, int); +extern int _sigaction(int, struct sigaction *, struct sigaction *); diff --git a/include/bits/netbsd/amd64/arch/sigaction.h b/include/bits/netbsd/amd64/arch/sigaction.h @@ -0,0 +1,15 @@ +typedef unsigned int sigset_t; +typedef struct siginfo siginfo_t; + +struct sigaction { + union { + void (*__sa_handler)(int); + void (*__sa_sigaction)(int, siginfo_t *, void *); + } __sigaction_u; + + sigset_t sa_mask; + int sa_flags; +}; + +#define sa_handler __sigaction_u.__sa_handler +#define sa_sigaction __sigaction_u.__sa_sigaction diff --git a/include/bits/netbsd/amd64/stdint.h b/include/bits/netbsd/amd64/arch/stdint.h diff --git a/include/bits/netbsd/amd64/time.h b/include/bits/netbsd/amd64/arch/time.h diff --git a/include/bits/netbsd/sys.h b/include/bits/netbsd/sys.h @@ -12,12 +12,6 @@ typedef int pid_t; -struct sigaction { - void (*sa_handler)(int); - char sa_mask[8]; - int sa_flags; -}; - extern pid_t _getpid(void); -extern int _kill(pid_t pid, int signum); -extern int _sigaction(int sig, struct sigaction *new, struct sigaction *old); +extern int _kill(pid_t, int); +extern int _sigaction(int, struct sigaction *, struct sigaction *); diff --git a/include/bits/openbsd/sys.h b/include/bits/openbsd/sys.h @@ -15,5 +15,5 @@ typedef int pid_t; struct sigaction; extern pid_t _getpid(void); -extern int _kill(pid_t pid, int signum); -extern int _sigaction(int sig, struct sigaction *new, struct sigaction *old); +extern int _kill(pid_t, int); +extern int _sigaction(int, struct sigaction *, struct sigaction *);