Fix build on PowerPC

PowerPC does not provide ucontext.gregs or the REG_ERR define.

Found while testing big endian platform.
This commit is contained in:
Thomas Jarosch 2014-12-31 01:44:50 +01:00
parent 58f4660c94
commit 9438b49bfb
1 changed files with 1 additions and 1 deletions

View File

@ -317,7 +317,7 @@ static void CppcheckSignalHandler(int signo, siginfo_t * info, void * context)
int type = -1; int type = -1;
pid_t killid = getpid(); pid_t killid = getpid();
const ucontext_t* uc = reinterpret_cast<const ucontext_t*>(context); const ucontext_t* uc = reinterpret_cast<const ucontext_t*>(context);
#ifdef __linux__ #if defined(__linux__) && defined(REG_ERR)
killid = (pid_t) syscall(SYS_gettid); killid = (pid_t) syscall(SYS_gettid);
if (uc) { if (uc) {
type = (int)uc->uc_mcontext.gregs[REG_ERR] & 2; type = (int)uc->uc_mcontext.gregs[REG_ERR] & 2;