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#if defined(ABSL_STACKTRACE_INL_HEADER)
25#error ABSL_STACKTRACE_INL_HEADER cannot be directly set
26
27#elif defined(_WIN32)
28#define ABSL_STACKTRACE_INL_HEADER \
29 "absl/debugging/internal/stacktrace_win32-inl.inc"
30
31#elif defined(__linux__) && !defined(__ANDROID__)
32
33#if !defined(NO_FRAME_POINTER)
34# if defined(__i386__) || defined(__x86_64__)
35#define ABSL_STACKTRACE_INL_HEADER \
36 "absl/debugging/internal/stacktrace_x86-inl.inc"
37# elif defined(__ppc__) || defined(__PPC__)
38#define ABSL_STACKTRACE_INL_HEADER \
39 "absl/debugging/internal/stacktrace_powerpc-inl.inc"
40# elif defined(__aarch64__)
41#define ABSL_STACKTRACE_INL_HEADER \
42 "absl/debugging/internal/stacktrace_aarch64-inl.inc"
43# elif defined(__arm__)
44// Note: When using glibc this may require -funwind-tables to function properly.
45#define ABSL_STACKTRACE_INL_HEADER \
46 "absl/debugging/internal/stacktrace_generic-inl.inc"
47# else
48#define ABSL_STACKTRACE_INL_HEADER \
49 "absl/debugging/internal/stacktrace_unimplemented-inl.inc"
50# endif
51#else // defined(NO_FRAME_POINTER)
52# if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__)
53#define ABSL_STACKTRACE_INL_HEADER \
54 "absl/debugging/internal/stacktrace_generic-inl.inc"
55# elif defined(__ppc__) || defined(__PPC__)
56#define ABSL_STACKTRACE_INL_HEADER \
57 "absl/debugging/internal/stacktrace_generic-inl.inc"
58# else
59#define ABSL_STACKTRACE_INL_HEADER \
60 "absl/debugging/internal/stacktrace_unimplemented-inl.inc"
61# endif
62#endif // NO_FRAME_POINTER
63
64#else
65#define ABSL_STACKTRACE_INL_HEADER \
66 "absl/debugging/internal/stacktrace_unimplemented-inl.inc"
67
68#endif
69
70#endif // ABSL_DEBUGGING_INTERNAL_STACKTRACE_CONFIG_H_
71