diff mbox series

[v2,08/14] add predefined macros for wint_t

Message ID 20181212164554.43133-9-luc.vanoostenryck@gmail.com (mailing list archive)
State Superseded, archived
Headers show
Series predefined macros for intmax_t/intptr_t/... | expand

Commit Message

Luc Van Oostenryck Dec. 12, 2018, 4:45 p.m. UTC
This type seems to use 'unsigned int' on all archs but for
Darwin & FreeBSD.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 lib.c    | 5 +++++
 target.c | 1 +
 target.h | 1 +
 3 files changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/lib.c b/lib.c
index 0abefa083..605f9edd5 100644
--- a/lib.c
+++ b/lib.c
@@ -520,6 +520,10 @@  static void handle_arch_m64_finalize(void)
 #endif
 		break;
 	}
+
+#if defined(__FreeBSD__) || defined(__APPLE__)
+	wint_ctype = &int_ctype;
+#endif
 }
 
 static void handle_arch_msize_long_finalize(void)
@@ -1250,6 +1254,7 @@  static void predefined_macros(void)
 	predefined_ctype("SHRT",      &short_ctype, PTYPE_MAX|PTYPE_WIDTH);
 	predefined_ctype("SCHAR",      &char_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 e09eff865..57866c337 100644
--- a/target.c
+++ b/target.c
@@ -6,6 +6,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))"
diff --git a/target.h b/target.h
index 74f51ffeb..998d25af5 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))"