From: Ben Pfaff Date: Thu, 16 Dec 2010 19:04:14 +0000 (-0800) Subject: backtrace: Only use __builtin_frame_address if GNU C is in use. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4fd8d288ad1530be566cdeb503fb63a43c149ff;p=openvswitch backtrace: Only use __builtin_frame_address if GNU C is in use. This eliminates one small GNU C dependency. --- diff --git a/lib/backtrace.c b/lib/backtrace.c index 282f6b86..91549db3 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 }