Delete asection.symbol_ptr_ptr
[binutils-gdb.git] / gprofng / common / gp-defs.h
blobe0471f334a23c4d9497cee1044be5d9e9bac7b37
1 /* Copyright (C) 2021-2024 Free Software Foundation, Inc.
2 Contributed by Oracle.
4 This file is part of GNU Binutils.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
9 any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, 51 Franklin Street - Fifth Floor, Boston,
19 MA 02110-1301, USA. */
21 #ifndef _GP_DEFS_H_
22 #define _GP_DEFS_H_
24 /* Define the ARCH and WSIZE predicates */
26 * The way we define and use predicates is similar to the
27 * standard #assert with one important exception:
28 * if an argument of a predicate is not known the result
29 * is 'false' and we want a compile time error to avoid
30 * silent results from typos like ARCH(INTEL), COMPILER(gnu),
31 * etc.
33 #define ARCH(x) TOK_A_##x(ARCH)
34 #define TOK_A_Aarch64(x) x##_Aarch64
35 #define TOK_A_RISCV(x) x##_RISCV
36 #define TOK_A_SPARC(x) x##_SPARC
37 #define TOK_A_Intel(x) x##_Intel
39 #define WSIZE(x) TOK_W_##x(WSIZE)
40 #define TOK_W_32(x) x##_32
41 #define TOK_W_64(x) x##_64
43 #if defined(sparc) || defined(__sparcv9)
44 #define ARCH_SPARC 1
45 #elif defined(__i386__) || defined(__x86_64)
46 #define ARCH_Intel 1
47 #elif defined(__aarch64__)
48 #define ARCH_Aarch64 1
49 #elif defined(__riscv)
50 #define ARCH_RISCV 1
51 #else
52 #error "Undefined platform"
53 #endif
55 #if defined(__sparcv9) || defined(__x86_64) || defined(__aarch64__) || defined(__riscv)
56 #define WSIZE_64 1
57 #else
58 #define WSIZE_32 1
59 #endif
61 #ifndef ATTRIBUTE_FALLTHROUGH
62 # if (GCC_VERSION >= 7000)
63 # define ATTRIBUTE_FALLTHROUGH __attribute__ ((__fallthrough__))
64 # else
65 # define ATTRIBUTE_FALLTHROUGH /* Fall through */
66 # endif
67 #endif
69 #if defined(__MUSL_LIBC)
70 #define ino64_t ino_t
71 #define off64_t off_t
72 #define fpos64_t fpos_t
73 #endif
75 #endif