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

Nick Desaulniers via libc-commits libc-commits at lists.llvm.org
Tue Feb 4 11:08:03 PST 2025


================
@@ -8,14 +8,16 @@
 
 #include "src/signal/signal.h"
 #include "hdr/signal_macros.h"
-#include "hdr/types/sighandler_t.h"
 #include "src/__support/common.h"
 #include "src/__support/macros/config.h"
 #include "src/signal/sigaction.h"
 
 namespace LIBC_NAMESPACE_DECL {
 
-LLVM_LIBC_FUNCTION(sighandler_t, signal, (int signum, sighandler_t handler)) {
+// Our LLVM_LIBC_FUNCTION macro doesn't handle function pointer return types.
+using signal_handler = void (*)(int);
----------------
nickdesaulniers wrote:

hmm...no nevermind. We'd only be able to do `decltype(signal)`, which would not be the type of the parameter or return value.

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


More information about the libc-commits mailing list