Add -lpthread in addition to -pthread on Linux.
[platform/upstream/glog.git] / src / stacktrace.h
1 // Copyright 2000 - 2007 Google Inc.
2 // All rights reserved.
3 //
4 // Routines to extract the current stack trace.  These functions are
5 // thread-safe.
6
7 #ifndef BASE_STACKTRACE_H_
8 #define BASE_STACKTRACE_H_
9
10 #include "config.h"
11
12 _START_GOOGLE_NAMESPACE_
13
14 // This is similar to the GetStackFrames routine, except that it returns
15 // the stack trace only, and not the stack frame sizes as well.
16 // Example:
17 //      main() { foo(); }
18 //      foo() { bar(); }
19 //      bar() {
20 //        void* result[10];
21 //        int depth = GetStackFrames(result, 10, 1);
22 //      }
23 //
24 // This produces:
25 //      result[0]       foo
26 //      result[1]       main
27 //           ....       ...
28 //
29 // "result" must not be NULL.
30 extern int GetStackTrace(void** result, int max_depth, int skip_count);
31
32 _END_GOOGLE_NAMESPACE_
33
34 #endif  // BASE_STACKTRACE_H_