Avoid linking win32 signals impl

This shaves ~4kb off o/tiny/examples/hello2.com by avoiding linking the
WIN32 signals polyfill unless sigaction() is being used.

See #965
This commit is contained in:
Justine Tunney 2023-11-29 04:09:31 -08:00
parent 2b960bb249
commit 70155df7a9
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
8 changed files with 37 additions and 31 deletions

View file

@ -218,10 +218,12 @@ textwindows int __sig_raise(volatile int sig, int sic) {
}
textwindows int __sig_relay(int sig, int sic, sigset_t waitmask) {
sigset_t m;
int handler_was_called;
sigset_t m = __sig_begin(waitmask);
m = atomic_exchange_explicit(&__get_tls()->tib_sigmask, waitmask,
memory_order_acquire);
handler_was_called = __sig_raise(sig, SI_KERNEL);
__sig_finish(m);
atomic_store_explicit(&__get_tls()->tib_sigmask, m, memory_order_release);
return handler_was_called;
}