From a9948c5dbfe9a5a6bc4487386af4440c47eb7b3a Mon Sep 17 00:00:00 2001 From: Thomas Jarosch Date: Mon, 17 Jun 2013 17:03:05 +0200 Subject: [PATCH] Add ugly cast for our siginfo_t forward declaration. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit gcc complained: /root/rpmbuild/BUILD/libi2ncommon-2.4/utils/signalfunc.cpp: In function ‘bool I2n::SystemTools::install_signal_handler(I2n::SystemTools::Signal, void (*)(int, siginfo*, void*))’: /root/rpmbuild/BUILD/libi2ncommon-2.4/utils/signalfunc.cpp:370: error: invalid static_cast from type ‘void (*)(int, siginfo*, void*)’ to type ‘void (*)(int, siginfo_t*, void*)’ We can get away with casting function pointer types on x86: http://stackoverflow.com/questions/559581/casting-a-function-pointer-to-another-type Not sure if it's really worth to avoid including signal.h from signalfunc.hpp... --- utils/signalfunc.cpp | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/utils/signalfunc.cpp b/utils/signalfunc.cpp index bee98b6..a937b43 100644 --- a/utils/signalfunc.cpp +++ b/utils/signalfunc.cpp @@ -367,7 +367,7 @@ bool install_signal_handler( ) { struct sigaction new_action; - new_action.sa_sigaction= handler; + new_action.sa_sigaction= (void (*)(int, siginfo_t*, void*))(handler); sigemptyset( &new_action.sa_mask ); new_action.sa_flags= SA_SIGINFO; new_action.sa_restorer= NULL; -- 1.7.1