[libc-commits] [libc] [libc][signal] clean up usage of sighandler_t (PR #125745)

via libc-commits libc-commits at lists.llvm.org
Thu Feb 6 07:13:09 PST 2025


================
@@ -0,0 +1,17 @@
+//===-- Definition of sighandler_t ----------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_TYPES_SIGHANDLER_T_H
+#define LLVM_LIBC_TYPES_SIGHANDLER_T_H
+
+#ifdef __linux__
----------------
enh-google wrote:

i flirted with that myself for bionic, but it's a bit more complicated in practice --- "what when the GNU variant _conflicts_ with the POSIX one?", say, or "what when people are trying to build code that's incompatible with GNU extensions [because they use some of the names themselves, say]"...

(the weird one for Android is `_BSD_SOURCE` where by historical accident that's always on. but `_GNU_SOURCE` is something developers are used to turning on/off either via `-std=gnu23` vs `-std=c23` or `-D`/`#define`.)

https://github.com/llvm/llvm-project/pull/125745


More information about the libc-commits mailing list