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...
)
{
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;