diff --git a/src/signalhandler.cc b/src/signalhandler.cc index 8d9ab4b..9fc91b3 100644 --- a/src/signalhandler.cc +++ b/src/signalhandler.cc @@ -41,6 +41,9 @@ #ifdef HAVE_UCONTEXT_H # include #endif +#ifdef HAVE_SYS_UCONTEXT_H +# include +#endif #include _START_GOOGLE_NAMESPACE_ @@ -66,7 +69,7 @@ const struct { // Returns the program counter from signal context, NULL if unknown. void* GetPC(void* ucontext_in_void) { -#if defined(HAVE_UCONTEXT_H) && defined(PC_FROM_UCONTEXT) +#if (defined(HAVE_UCONTEXT_H) || defined(HAVE_SYS_UCONTEXT_H)) && defined(PC_FROM_UCONTEXT) if (ucontext_in_void != NULL) { ucontext_t *context = reinterpret_cast(ucontext_in_void); return (void*)context->PC_FROM_UCONTEXT;