mes: Add RISC-V architecture detection.

* src/mes.c: Add ifdefs to detect when compiled on riscv32 or riscv64
architectures.
This commit is contained in:
W. J. van der Laan 2021-04-03 21:26:03 +00:00 committed by Jan (janneke) Nieuwenhuizen
parent 165ce66957
commit d19876e0e4
1 changed files with 9 additions and 0 deletions

View File

@ -1,6 +1,7 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2016,2017,2018,2019,2020,2021 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2021 W. J. van der Laan <laanwj@protonmail.com>
*
* This file is part of GNU Mes.
*
@ -59,6 +60,14 @@ mes_environment (int argc, char **argv)
arch = "arm";
#elif __x86_64__
arch = "x86_64";
#elif __riscv
#if __riscv_xlen == 32
arch = "riscv32";
#elif __riscv_xlen == 64
arch = "riscv64";
#else
#error riscv xlen not supported
#endif
#else
#error arch not supported
#endif