From: Thomas Jarosch Date: Mon, 17 Jun 2013 15:03:05 +0000 (+0200) Subject: Add ugly cast for our siginfo_t forward declaration. X-Git-Tag: v2.6~13 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=a9948c5dbfe9a5a6bc4487386af4440c47eb7b3a;p=libi2ncommon Add ugly cast for our siginfo_t forward declaration. 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... --- 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;