aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-06-26 01:58:55 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-07-08 02:19:40 +0200
commitcc885f41d75db3a70219d9717088d0b3100432f8 (patch)
treeeba0eb868cb747d63f69a10bb063e98e974a7d66
parentc9676a3b0349a1053c673243af52a2ef1b272bd7 (diff)
downloadsparse-cc885f41d75db3a70219d9717088d0b3100432f8.tar.gz
mips: add predefines __MIPSEL__ or __MIPSEB__ & friends
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--target-mips.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/target-mips.c b/target-mips.c
index 3d73236f..1ff0760c 100644
--- a/target-mips.c
+++ b/target-mips.c
@@ -10,6 +10,16 @@ static void predefine_mips(const struct target *self)
predefine("_MIPS_SZINT", 1, "%d", int_ctype.bit_size);
predefine("_MIPS_SZLONG", 1, "%d", long_ctype.bit_size);
predefine("_MIPS_SZPTR", 1, "%d", ptr_ctype.bit_size);
+
+ if (arch_big_endian) {
+ predefine("_MIPSEB", 1, "1");
+ predefine("__MIPSEB", 1, "1");
+ predefine("__MIPSEB__", 1, "1");
+ } else {
+ predefine("_MIPSEL", 1, "1");
+ predefine("__MIPSEL", 1, "1");
+ predefine("__MIPSEL__", 1, "1");
+ }
}