summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-12-12 13:58:33 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-12-17 21:56:32 +0100
commite019565f57e76774f24c54b9b89a5e44fb4052a1 (patch)
tree8749a259a240993c14e101f61739a53b48c8a222
parent63d65194edf1ab5017a4faebed7f816e5cbc24bd (diff)
downloadsparse-e019565f57e76774f24c54b9b89a5e44fb4052a1.tar.gz
add predefined macros for wint_t
This type seems to use 'unsigned int' on all archs but for Darwin & FreeBSD. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--lib.c1
-rw-r--r--target.c4
-rw-r--r--target.h1
3 files changed, 6 insertions, 0 deletions
diff --git a/lib.c b/lib.c
index dc4a2172..e83eaf70 100644
--- a/lib.c
+++ b/lib.c
@@ -1231,6 +1231,7 @@ static void predefined_macros(void)
predefined_ctype("SHRT", &short_ctype, PTYPE_MAX|PTYPE_WIDTH);
predefined_ctype("SCHAR", &schar_ctype, PTYPE_MAX|PTYPE_WIDTH);
predefined_ctype("WCHAR", wchar_ctype, PTYPE_ALL_T|PTYPE_TYPE);
+ predefined_ctype("WINT", wint_ctype, PTYPE_ALL_T|PTYPE_TYPE);
predefined_ctype("INT", &int_ctype, PTYPE_ALL);
predefined_ctype("LONG", &long_ctype, PTYPE_ALL);
diff --git a/target.c b/target.c
index a12b314e..d4329fe5 100644
--- a/target.c
+++ b/target.c
@@ -7,6 +7,7 @@
struct symbol *size_t_ctype = &uint_ctype;
struct symbol *ssize_t_ctype = &int_ctype;
struct symbol *wchar_ctype = &int_ctype;
+struct symbol *wint_ctype = &uint_ctype;
/*
* For "__attribute__((aligned))"
@@ -72,4 +73,7 @@ void init_target(void)
#if defined(__CYGWIN__)
wchar_ctype = &ushort_ctype;
#endif
+#if defined(__FreeBSD__) || defined(__APPLE__)
+ wint_ctype = &int_ctype;
+#endif
}
diff --git a/target.h b/target.h
index 74f51ffe..998d25af 100644
--- a/target.h
+++ b/target.h
@@ -4,6 +4,7 @@
extern struct symbol *size_t_ctype;
extern struct symbol *ssize_t_ctype;
extern struct symbol *wchar_ctype;
+extern struct symbol *wint_ctype;
/*
* For "__attribute__((aligned))"