diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2019-12-02 01:14:09 +0100 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2019-12-16 10:28:27 +0100 |
| commit | efd9af566c055f5cb6b3a90113edc512bb552c44 (patch) | |
| tree | 7b3b7046cf246dab09dd60bc431127bcd9984e82 /target-s390.c | |
| parent | 8e0199b78ddbd4c203d2c4161748881593805fc5 (diff) | |
| download | sparse-dev-efd9af566c055f5cb6b3a90113edc512bb552c44.tar.gz | |
arch: move target-specific predefines to the target files.
Now that each supported arch has its own target file,
move the arch-specific predefines to these files too.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'target-s390.c')
| -rw-r--r-- | target-s390.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/target-s390.c b/target-s390.c index 277e0909..159a6b11 100644 --- a/target-s390.c +++ b/target-s390.c @@ -3,6 +3,11 @@ #include "machine.h" +static void predefine_s390(const struct target *self) +{ + predefine("__s390__", 1, "1"); +} + const struct target target_s390 = { .mach = MACH_S390, .bitness = ARCH_LP32, @@ -14,8 +19,19 @@ const struct target target_s390 = { .max_fp_alignment = 8, .target_64bit = &target_s390x, + + .predefine = predefine_s390, }; + +static void predefine_s390x(const struct target *self) +{ + predefine("__zarch__", 1, "1"); + predefine("__s390x__", 1, "1"); + + predefine_s390(self); +} + const struct target target_s390x = { .mach = MACH_S390X, .bitness = ARCH_LP64, @@ -26,4 +42,6 @@ const struct target target_s390x = { .max_fp_alignment = 8, .target_32bit = &target_s390, + + .predefine = predefine_s390x, }; |
