diff options
-rw-r--r-- | sal/osl/unx/backtrace.c | 14 | ||||
-rw-r--r-- | sal/osl/unx/backtrace.h | 14 |
2 files changed, 14 insertions, 14 deletions
diff --git a/sal/osl/unx/backtrace.c b/sal/osl/unx/backtrace.c index 4741f36ff574..35bea16bf06a 100644 --- a/sal/osl/unx/backtrace.c +++ b/sal/osl/unx/backtrace.c @@ -134,9 +134,8 @@ void backtrace_symbols_fd( void **buffer, int size, int fd ) } } -#endif /* defined __sun */ +#elif defined FREEBSD || defined NETBSD || defined OPENBSD || defined(DRAGONFLY) -#if defined FREEBSD || defined NETBSD || defined OPENBSD || defined(DRAGONFLY) #include <dlfcn.h> #include <pthread.h> #include <setjmp.h> @@ -214,17 +213,14 @@ void backtrace_symbols_fd( void **buffer, int size, int fd ) fclose( fp ); } } -#endif /* defined FREEBSD */ -#ifdef LINUX +#elif defined LINUX #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif -#endif /* defined LINUX */ - -#if defined( MACOSX ) +#elif defined( MACOSX ) #include <dlfcn.h> #include <stdio.h> @@ -292,9 +288,8 @@ void backtrace_symbols_fd( void **buffer, int size, int fd ) } } -#endif /* defined MACOSX */ +#else -#if defined(AIX) int backtrace( void **buffer, int max_frames ) { return 0; @@ -309,6 +304,7 @@ char ** backtrace_symbols(void * const * buffer, int size) void backtrace_symbols_fd( void **buffer, int size, int fd ) { } + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sal/osl/unx/backtrace.h b/sal/osl/unx/backtrace.h index 4695fd2d2fcc..5fafc1c90622 100644 --- a/sal/osl/unx/backtrace.h +++ b/sal/osl/unx/backtrace.h @@ -17,8 +17,14 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#if defined (__sun) || defined (FREEBSD) || defined (NETBSD) || \ - defined (OPENBSD) || defined (DRAGONFLY) || defined (MACOSX) +#ifndef INCLUDED_SAL_OSL_UNX_BACKTRACE_H +#define INCLUDED_SAL_OSL_UNX_BACKTRACE_H + +#if defined (LINUX) + +#include <execinfo.h> + +#else #ifdef __cplusplus extern "C" { @@ -45,10 +51,8 @@ struct frame { } /* extern "C" */ #endif -#endif /* defined __sun || FREEBSD || NETBSD || OPENBSD */ +#endif -#if defined (LINUX) -#include <execinfo.h> #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |