diff options
| author | Marc Mutz <marc.mutz@qt.io> | 2023-11-07 19:05:33 +0100 |
|---|---|---|
| committer | Marc Mutz <marc.mutz@qt.io> | 2023-11-13 17:58:50 +0100 |
| commit | 9bed675df8eed361439a1d5de43a9dd41359be5c (patch) | |
| tree | e52a440fbdbae57645d5b28e5fd6b0876defd96a /examples/widgets/doc/src | |
| parent | e795898cc4387e81ef36c848acdc97bf745d5c8d (diff) | |
De-inline qt_ignore_sigpipe()
It contains a static guard variable, so every user of the function
outside of QtCore (at least QtNetwork contains one) will create its
own copy of the guard variable. While mostly harmless, we'd be
executing too many sigaction() calls this way.
As a drive-by, remove the qatomic.h include and replace the C-style
struct initialization (memset()) with C++-style
(value-)initialization.
I also tried C++20/C99 designated initializers, but they cannot be
used here: some platforms #define sa_handler to some nested member
accessor because they hold the field in a union. While .a.b is allowed
in C99, it isn't in C++20, so we'd have to move this function's
definition into a .c file to compile `{ .sa_handler = SIG_IGN }`.
That'd be too much hassle.
Mark the function as noexcept, because it is (sigaction(2) is not a
Posix Cancellation Point), and, now that it's out-of-line, that
actually matters to codegen.
Change-Id: Iffab9e6b57822a4d1be8b81ed5948ce186df978e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'examples/widgets/doc/src')
0 files changed, 0 insertions, 0 deletions
