1 /* Copyright (C) 2021-2024 Free Software Foundation, Inc.
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)
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. */
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),
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)
45 #elif defined(__i386__) || defined(__x86_64)
47 #elif defined(__aarch64__)
48 #define ARCH_Aarch64 1
49 #elif defined(__riscv)
52 #error "Undefined platform"
55 #if defined(__sparcv9) || defined(__x86_64) || defined(__aarch64__) || defined(__riscv)
61 #ifndef ATTRIBUTE_FALLTHROUGH
62 # if (GCC_VERSION >= 7000)
63 # define ATTRIBUTE_FALLTHROUGH __attribute__ ((__fallthrough__))
65 # define ATTRIBUTE_FALLTHROUGH /* Fall through */
69 #if defined(__MUSL_LIBC)
72 #define fpos64_t fpos_t