[ovs-dev] [PATCH] backtrace: Only use __builtin_frame_address if GNU C is in use.
Ben Pfaff
blp at nicira.com
Thu Dec 16 19:04:16 UTC 2010
This eliminates one small GNU C dependency.
---
lib/backtrace.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/lib/backtrace.c b/lib/backtrace.c
index 282f6b8..91549db 100644
--- a/lib/backtrace.c
+++ b/lib/backtrace.c
@@ -83,6 +83,7 @@ in_stack(void *p)
void
backtrace_capture(struct backtrace *backtrace)
{
+#ifdef __GNUC__
void **frame;
size_t n;
@@ -95,4 +96,7 @@ backtrace_capture(struct backtrace *backtrace)
backtrace->frames[n++] = (uintptr_t) frame[1];
}
backtrace->n_frames = n;
+#else
+ backtrace->n_frames = 0;
+#endif
}
--
1.7.1
More information about the dev
mailing list