diff options
author | mengqinggang <mengqinggang@loongson.cn> | 2025-08-08 16:22:59 +0800 |
---|---|---|
committer | Lulu Cheng <chenglulu@loongson.cn> | 2025-08-12 19:08:07 +0800 |
commit | 9467435253948b83fcb5f7430f6cd571236960d8 (patch) | |
tree | 973eb2a2950e050e6b5e14a8b5c27f14d55d6601 /gcc | |
parent | 6405c5c4419bef9589baf22daf162a6928af5441 (diff) | |
download | gcc-9467435253948b83fcb5f7430f6cd571236960d8.zip gcc-9467435253948b83fcb5f7430f6cd571236960d8.tar.gz gcc-9467435253948b83fcb5f7430f6cd571236960d8.tar.bz2 |
LoongArch: macro instead enum for base abi type
enum can't be used in #if.
For #if expression, identifiers that are not macros,
which are all considered to be the number zero.
This patch may fix https://sourceware.org/bugzilla/show_bug.cgi?id=32776.
gcc/ChangeLog:
* config/loongarch/loongarch-def.h (ABI_BASE_LP64D): New macro.
(ABI_BASE_LP64F): New macro.
(ABI_BASE_LP64S): New macro.
(N_ABI_BASE_TYPES): New macro.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/loongarch/loongarch-def.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/gcc/config/loongarch/loongarch-def.h b/gcc/config/loongarch/loongarch-def.h index 0bcd2a7..0a7d0c9 100644 --- a/gcc/config/loongarch/loongarch-def.h +++ b/gcc/config/loongarch/loongarch-def.h @@ -78,12 +78,10 @@ extern loongarch_def_array<const char *, N_ISA_EXT_TYPES> /* Base ABI */ -enum { - ABI_BASE_LP64D = 0, - ABI_BASE_LP64F = 1, - ABI_BASE_LP64S = 2, - N_ABI_BASE_TYPES = 3 -}; +#define ABI_BASE_LP64D 0 +#define ABI_BASE_LP64F 1 +#define ABI_BASE_LP64S 2 +#define N_ABI_BASE_TYPES 3 extern loongarch_def_array<const char *, N_ABI_BASE_TYPES> loongarch_abi_base_strings; |