math: array parameters can be NULL
[smatch.git] / target-x86.c
blobd770349c27e7fbb3756dee251af48186a17653b0
1 #include "symbol.h"
2 #include "target.h"
3 #include "machine.h"
6 static void init_x86(const struct target *target)
8 switch (arch_os) {
9 case OS_CYGWIN:
10 wchar_ctype = &ushort_ctype;
11 break;
12 case OS_DARWIN:
13 int64_ctype = &llong_ctype;
14 uint64_ctype = &ullong_ctype;
15 wint_ctype = &int_ctype;
16 break;
17 case OS_FREEBSD:
18 wint_ctype = &int_ctype;
19 break;
20 case OS_OPENBSD:
21 wchar_ctype = &int_ctype;
22 wint_ctype = &int_ctype;
23 break;
28 static void predefine_i386(const struct target *self)
30 predefine("__i386__", 1, "1");
31 predefine("__i386", 1, "1");
32 predefine_nostd("i386");
35 const struct target target_i386 = {
36 .mach = MACH_I386,
37 .bitness = ARCH_LP32,
38 .big_endian = 0,
39 .unsigned_char = 0,
41 .wchar = &long_ctype,
42 .bits_in_longdouble = 96,
43 .max_fp_alignment = 4,
45 .init = init_x86,
46 .target_64bit = &target_x86_64,
48 .predefine = predefine_i386,
52 static void predefine_x86_64(const struct target *self)
54 predefine("__x86_64__", 1, "1");
55 predefine("__x86_64", 1, "1");
56 predefine("__amd64__", 1, "1");
57 predefine("__amd64", 1, "1");
60 const struct target target_x86_64 = {
61 .mach = MACH_X86_64,
62 .bitness = ARCH_LP64,
63 .big_endian = 0,
64 .unsigned_char = 0,
65 .has_int128 = 1,
67 .bits_in_longdouble = 128,
68 .max_fp_alignment = 16,
70 .init = init_x86,
71 .target_32bit = &target_i386,
73 .predefine = predefine_x86_64,