aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/target.c
diff options
authorLinus Torvalds <torvalds@ppc970.osdl.org>2004-04-28 16:20:38 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:01:40 -0700
commitddaa4fc95836673ce96c144821fc4e0f752cf793 (patch)
tree10e949b00eb44ff67a0b42d4bd08513297d5d1a0 /target.c
parent7195dddfaafa39d61ce710733f0267095f2fb4d0 (diff)
downloadsparse-dev-ddaa4fc95836673ce96c144821fc4e0f752cf793.tar.gz
Use variables for target data structure information,
instead of hardcoding it at compile time. This allows us to do "cross-checks" much more easily.
Diffstat (limited to 'target.c')
-rw-r--r--target.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/target.c b/target.c
new file mode 100644
index 00000000..6aece3bd
--- /dev/null
+++ b/target.c
@@ -0,0 +1,49 @@
+#ifndef TARGET_H
+#define TARGET_H
+
+#include <stdio.h>
+
+#include "symbol.h"
+#include "target.h"
+
+struct symbol *size_t_ctype = &ulong_ctype;
+struct symbol *ssize_t_ctype = &long_ctype;
+
+/*
+ * For "__attribute__((aligned))"
+ */
+int MAX_ALIGNMENT = 16;
+
+/*
+ * Integer data types
+ */
+int BITS_IN_CHAR = 8;
+int BITS_IN_SHORT = 16;
+int BITS_IN_INT = 32;
+int BITS_IN_LONG = 32;
+int BITS_IN_LONGLONG = 64;
+
+int MAX_INT_ALIGNMENT = 4;
+
+/*
+ * Floating point data types
+ */
+int BITS_IN_FLOAT = 32;
+int BITS_IN_DOUBLE = 64;
+int BITS_IN_LONGDOUBLE = 80;
+
+int MAX_FP_ALIGNMENT = 8;
+
+/*
+ * Pointer data type
+ */
+int BITS_IN_POINTER = 32;
+int POINTER_ALIGNMENT = 4;
+
+/*
+ * Enum data types
+ */
+int BITS_IN_ENUM = 32;
+int ENUM_ALIGNMENT = 4;
+
+#endif