Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:27:16

0001 /*
0002  * Copyright 2017 The Abseil Authors.
0003  *
0004  * Licensed under the Apache License, Version 2.0 (the "License");
0005  * you may not use this file except in compliance with the License.
0006  * You may obtain a copy of the License at
0007  *
0008  *      https://www.apache.org/licenses/LICENSE-2.0
0009  *
0010  * Unless required by applicable law or agreed to in writing, software
0011  * distributed under the License is distributed on an "AS IS" BASIS,
0012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0013  * See the License for the specific language governing permissions and
0014  * limitations under the License.
0015 
0016  * Defines ABSL_STACKTRACE_INL_HEADER to the *-inl.h containing
0017  * actual unwinder implementation.
0018  * This header is "private" to stacktrace.cc.
0019  * DO NOT include it into any other files.
0020 */
0021 #ifndef ABSL_DEBUGGING_INTERNAL_STACKTRACE_CONFIG_H_
0022 #define ABSL_DEBUGGING_INTERNAL_STACKTRACE_CONFIG_H_
0023 
0024 #include "absl/base/config.h"
0025 
0026 #if defined(ABSL_STACKTRACE_INL_HEADER)
0027 #error ABSL_STACKTRACE_INL_HEADER cannot be directly set
0028 
0029 #elif defined(_WIN32)
0030 #define ABSL_STACKTRACE_INL_HEADER \
0031     "absl/debugging/internal/stacktrace_win32-inl.inc"
0032 
0033 #elif defined(__APPLE__)
0034 #ifdef ABSL_HAVE_THREAD_LOCAL
0035 // Thread local support required for UnwindImpl.
0036 #define ABSL_STACKTRACE_INL_HEADER \
0037   "absl/debugging/internal/stacktrace_generic-inl.inc"
0038 #endif  // defined(ABSL_HAVE_THREAD_LOCAL)
0039 
0040 // Emscripten stacktraces rely on JS. Do not use them in standalone mode.
0041 #elif defined(__EMSCRIPTEN__) && !defined(STANDALONE_WASM)
0042 #define ABSL_STACKTRACE_INL_HEADER \
0043   "absl/debugging/internal/stacktrace_emscripten-inl.inc"
0044 
0045 #elif defined(__linux__) && !defined(__ANDROID__)
0046 
0047 #if defined(NO_FRAME_POINTER) && \
0048     (defined(__i386__) || defined(__x86_64__) || defined(__aarch64__))
0049 // Note: The libunwind-based implementation is not available to open-source
0050 // users.
0051 #define ABSL_STACKTRACE_INL_HEADER \
0052   "absl/debugging/internal/stacktrace_libunwind-inl.inc"
0053 #define STACKTRACE_USES_LIBUNWIND 1
0054 #elif defined(NO_FRAME_POINTER) && defined(__has_include)
0055 #if __has_include(<execinfo.h>)
0056 // Note: When using glibc this may require -funwind-tables to function properly.
0057 #define ABSL_STACKTRACE_INL_HEADER \
0058   "absl/debugging/internal/stacktrace_generic-inl.inc"
0059 #endif  // __has_include(<execinfo.h>)
0060 #elif defined(__i386__) || defined(__x86_64__)
0061 #define ABSL_STACKTRACE_INL_HEADER \
0062   "absl/debugging/internal/stacktrace_x86-inl.inc"
0063 #elif defined(__ppc__) || defined(__PPC__)
0064 #define ABSL_STACKTRACE_INL_HEADER \
0065   "absl/debugging/internal/stacktrace_powerpc-inl.inc"
0066 #elif defined(__aarch64__)
0067 #define ABSL_STACKTRACE_INL_HEADER \
0068   "absl/debugging/internal/stacktrace_aarch64-inl.inc"
0069 #elif defined(__riscv)
0070 #define ABSL_STACKTRACE_INL_HEADER \
0071   "absl/debugging/internal/stacktrace_riscv-inl.inc"
0072 #elif defined(__has_include)
0073 #if __has_include(<execinfo.h>)
0074 // Note: When using glibc this may require -funwind-tables to function properly.
0075 #define ABSL_STACKTRACE_INL_HEADER \
0076   "absl/debugging/internal/stacktrace_generic-inl.inc"
0077 #endif  // __has_include(<execinfo.h>)
0078 #endif  // defined(__has_include)
0079 
0080 #endif  // defined(__linux__) && !defined(__ANDROID__)
0081 
0082 // Fallback to the empty implementation.
0083 #if !defined(ABSL_STACKTRACE_INL_HEADER)
0084 #define ABSL_STACKTRACE_INL_HEADER \
0085   "absl/debugging/internal/stacktrace_unimplemented-inl.inc"
0086 #endif
0087 
0088 #endif  // ABSL_DEBUGGING_INTERNAL_STACKTRACE_CONFIG_H_