RISC-V 32-bit support
[uclibc-ng.git] / libc / sysdeps / linux / riscv64 / bits / wordsize.h
blob1fc649aad864b75bc189068b4f3cea5862eb0b6d
1 /* Determine the wordsize from the preprocessor defines. RISC-V version.
2 Copyright (C) 2002-2018 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library. If not, see
17 <http://www.gnu.org/licenses/>. */
19 #if __riscv_xlen == (__SIZEOF_POINTER__ * 8)
20 # define __WORDSIZE __riscv_xlen
21 #else
22 # error unsupported ABI
23 #endif
25 #if __riscv_xlen == 64
26 # define __WORDSIZE_TIME64_COMPAT32 1
27 #else
28 # define __WORDSIZE_TIME64_COMPAT32 1
29 // # warning "rv32i-based targets are experimental"
30 #endif