tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

stacktrace_config.h (3695B)


      1 /*
      2 * Copyright 2017 The Abseil Authors.
      3 *
      4 * Licensed under the Apache License, Version 2.0 (the "License");
      5 * you may not use this file except in compliance with the License.
      6 * You may obtain a copy of the License at
      7 *
      8 *      https://www.apache.org/licenses/LICENSE-2.0
      9 *
     10 * Unless required by applicable law or agreed to in writing, software
     11 * distributed under the License is distributed on an "AS IS" BASIS,
     12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13 * See the License for the specific language governing permissions and
     14 * limitations under the License.
     15 
     16 * Defines ABSL_STACKTRACE_INL_HEADER to the *-inl.h containing
     17 * actual unwinder implementation.
     18 * This header is "private" to stacktrace.cc.
     19 * DO NOT include it into any other files.
     20 */
     21 #ifndef ABSL_DEBUGGING_INTERNAL_STACKTRACE_CONFIG_H_
     22 #define ABSL_DEBUGGING_INTERNAL_STACKTRACE_CONFIG_H_
     23 
     24 #include "absl/base/config.h"
     25 
     26 #if defined(ABSL_STACKTRACE_INL_HEADER)
     27 #error ABSL_STACKTRACE_INL_HEADER cannot be directly set
     28 
     29 #elif defined(_WIN32)
     30 #define ABSL_STACKTRACE_INL_HEADER \
     31    "absl/debugging/internal/stacktrace_win32-inl.inc"
     32 
     33 #elif defined(__APPLE__)
     34 #ifdef ABSL_HAVE_THREAD_LOCAL
     35 // Thread local support required for UnwindImpl.
     36 #define ABSL_STACKTRACE_INL_HEADER \
     37  "absl/debugging/internal/stacktrace_generic-inl.inc"
     38 #endif  // defined(ABSL_HAVE_THREAD_LOCAL)
     39 
     40 // Emscripten stacktraces rely on JS. Do not use them in standalone mode.
     41 #elif defined(__EMSCRIPTEN__) && !defined(STANDALONE_WASM)
     42 #define ABSL_STACKTRACE_INL_HEADER \
     43  "absl/debugging/internal/stacktrace_emscripten-inl.inc"
     44 
     45 #elif defined(__ANDROID__) && __ANDROID_API__ >= 33
     46 
     47 // Use the generic implementation for Android 33+ (Android T+). This is the
     48 // first version of Android for which <execinfo.h> implements backtrace().
     49 #define ABSL_STACKTRACE_INL_HEADER \
     50  "absl/debugging/internal/stacktrace_generic-inl.inc"
     51 
     52 #elif defined(__linux__) && !defined(__ANDROID__)
     53 
     54 #if defined(NO_FRAME_POINTER) && \
     55    (defined(__i386__) || defined(__x86_64__) || defined(__aarch64__))
     56 // Note: The libunwind-based implementation is not available to open-source
     57 // users.
     58 #define ABSL_STACKTRACE_INL_HEADER \
     59  "absl/debugging/internal/stacktrace_libunwind-inl.inc"
     60 #define STACKTRACE_USES_LIBUNWIND 1
     61 #elif defined(NO_FRAME_POINTER) && defined(__has_include)
     62 #if __has_include(<execinfo.h>)
     63 // Note: When using glibc this may require -funwind-tables to function properly.
     64 #define ABSL_STACKTRACE_INL_HEADER \
     65  "absl/debugging/internal/stacktrace_generic-inl.inc"
     66 #endif  // __has_include(<execinfo.h>)
     67 #elif defined(__i386__) || defined(__x86_64__)
     68 #define ABSL_STACKTRACE_INL_HEADER \
     69  "absl/debugging/internal/stacktrace_x86-inl.inc"
     70 #elif defined(__ppc__) || defined(__PPC__)
     71 #define ABSL_STACKTRACE_INL_HEADER \
     72  "absl/debugging/internal/stacktrace_powerpc-inl.inc"
     73 #elif defined(__aarch64__)
     74 #define ABSL_STACKTRACE_INL_HEADER \
     75  "absl/debugging/internal/stacktrace_aarch64-inl.inc"
     76 #elif defined(__riscv)
     77 #define ABSL_STACKTRACE_INL_HEADER \
     78  "absl/debugging/internal/stacktrace_riscv-inl.inc"
     79 #elif defined(__has_include)
     80 #if __has_include(<execinfo.h>)
     81 // Note: When using glibc this may require -funwind-tables to function properly.
     82 #define ABSL_STACKTRACE_INL_HEADER \
     83  "absl/debugging/internal/stacktrace_generic-inl.inc"
     84 #endif  // __has_include(<execinfo.h>)
     85 #endif  // defined(__has_include)
     86 
     87 #endif  // defined(__linux__) && !defined(__ANDROID__)
     88 
     89 // Fallback to the empty implementation.
     90 #if !defined(ABSL_STACKTRACE_INL_HEADER)
     91 #define ABSL_STACKTRACE_INL_HEADER \
     92  "absl/debugging/internal/stacktrace_unimplemented-inl.inc"
     93 #endif
     94 
     95 #endif  // ABSL_DEBUGGING_INTERNAL_STACKTRACE_CONFIG_H_