projects
/
openvswitch
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
57b7c6a
)
backtrace: Only use __builtin_frame_address if GNU C is in use.
author
Ben Pfaff
<blp@nicira.com>
Thu, 16 Dec 2010 19:04:14 +0000
(11:04 -0800)
committer
Ben Pfaff
<blp@nicira.com>
Thu, 23 Dec 2010 18:44:36 +0000
(10:44 -0800)
This eliminates one small GNU C dependency.
lib/backtrace.c
patch
|
blob
|
history
diff --git
a/lib/backtrace.c
b/lib/backtrace.c
index 282f6b86828b0ba79b393730b5d856ce37e13847..91549db347812b516e2eb4fb27b93c54349deb62 100644
(file)
--- 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
}