blob: 578e4968b0096118b81ec332378e1d5ce0e612ee [file] [log] [blame]
mistergc2e75482017-09-19 16:54:40 -04001/*
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 * http://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
Abseil Teamfcb10452018-12-04 11:01:12 -080024#if defined(ABSL_STACKTRACE_INL_HEADER)
mistergc2e75482017-09-19 16:54:40 -040025#error ABSL_STACKTRACE_INL_HEADER cannot be directly set
mistergc2e75482017-09-19 16:54:40 -040026
Abseil Teamfcb10452018-12-04 11:01:12 -080027#elif defined(_WIN32)
mistergc2e75482017-09-19 16:54:40 -040028#define ABSL_STACKTRACE_INL_HEADER \
29 "absl/debugging/internal/stacktrace_win32-inl.inc"
30
Abseil Teamfcb10452018-12-04 11:01:12 -080031#elif defined(__linux__) && !defined(__ANDROID__)
32
33#if !defined(NO_FRAME_POINTER)
mistergc2e75482017-09-19 16:54:40 -040034# 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__)
Abseil Teamfcb10452018-12-04 11:01:12 -080044// Note: When using glibc this may require -funwind-tables to function properly.
mistergc2e75482017-09-19 16:54:40 -040045#define ABSL_STACKTRACE_INL_HEADER \
Abseil Teamfcb10452018-12-04 11:01:12 -080046 "absl/debugging/internal/stacktrace_generic-inl.inc"
47# else
48#define ABSL_STACKTRACE_INL_HEADER \
49 "absl/debugging/internal/stacktrace_unimplemented-inl.inc"
mistergc2e75482017-09-19 16:54:40 -040050# endif
51#else // defined(NO_FRAME_POINTER)
52# if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__)
53#define ABSL_STACKTRACE_INL_HEADER \
Abseil Teamfcb10452018-12-04 11:01:12 -080054 "absl/debugging/internal/stacktrace_generic-inl.inc"
mistergc2e75482017-09-19 16:54:40 -040055# elif defined(__ppc__) || defined(__PPC__)
mistergc2e75482017-09-19 16:54:40 -040056#define ABSL_STACKTRACE_INL_HEADER \
57 "absl/debugging/internal/stacktrace_generic-inl.inc"
Abseil Teamfcb10452018-12-04 11:01:12 -080058# else
59#define ABSL_STACKTRACE_INL_HEADER \
60 "absl/debugging/internal/stacktrace_unimplemented-inl.inc"
mistergc2e75482017-09-19 16:54:40 -040061# endif
62#endif // NO_FRAME_POINTER
63
Abseil Teamfcb10452018-12-04 11:01:12 -080064#else
65#define ABSL_STACKTRACE_INL_HEADER \
66 "absl/debugging/internal/stacktrace_unimplemented-inl.inc"
67
mistergc2e75482017-09-19 16:54:40 -040068#endif
69
70#endif // ABSL_DEBUGGING_INTERNAL_STACKTRACE_CONFIG_H_