summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author <shinichiro.hamaji@gmail.com>2010-06-15 04:12:19 +0000
committer <shinichiro.hamaji@gmail.com>2010-06-15 04:12:19 +0000
commitc83adaa87d3708a55d8301ff24f799f6c6741b04 (patch)
tree1bc30e4b9aa0442f68126de6eadc2665af187090
parent1f8dac87fc254001a688c0dad7b294380cbc34cf (diff)
downloadglog-c83adaa87d3708a55d8301ff24f799f6c6741b04.tar.gz
glog-c83adaa87d3708a55d8301ff24f799f6c6741b04.tar.bz2
glog-c83adaa87d3708a55d8301ff24f799f6c6741b04.zip
Use sys/ucontext.h when it is found. Snow leopard needs this.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@86 eb4d4688-79bd-11dd-afb4-1d65580434c0
-rw-r--r--src/signalhandler.cc5
1 files changed, 4 insertions, 1 deletions
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 <ucontext.h>
#endif
+#ifdef HAVE_SYS_UCONTEXT_H
+# include <sys/ucontext.h>
+#endif
#include <algorithm>
_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_t *>(ucontext_in_void);
return (void*)context->PC_FROM_UCONTEXT;