aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAlexandre Oliva <oliva@adacore.com>2019-12-30 21:34:35 +0000
committerOlivier Hainque <hainque@gcc.gnu.org>2019-12-30 21:34:35 +0000
commit1361ae0e7647cbf4b77f917835c4d4aecba3e533 (patch)
tree7c9e9d0fdbb8143a6b7f96fae688fd9d2a83ff89 /gcc
parent4e6bcaa6622f03a709bf0472ffda2f2bd2e17682 (diff)
downloadgcc-1361ae0e7647cbf4b77f917835c4d4aecba3e533.zip
gcc-1361ae0e7647cbf4b77f917835c4d4aecba3e533.tar.gz
gcc-1361ae0e7647cbf4b77f917835c4d4aecba3e533.tar.bz2
Refine definitions for wchar_t/wint_t on VxWorks
This change refines the VxWorks macro definitions configuring wchar_t to accommodate the VxWorks7 environment, where wchar_t is now typically a 32bit type. We also ensure that the definitions for wint_t are always based on those for wchar_t, so the two remain in sync in environments where WCHAR_TYPE is redefined for a specific CPU architecture. 2019-12-30 Alexandre Oliva <oliva@adacore.com> Olivier Hainque <hainque@adacore.com> * config/vx-common.h (WCHAR_TYPE_SIZE): 32 on VxWorks 7. (WCHAR_TYPE): Pick accordingly. (WINT_TYPE_SIZE): Define in terms of WCHAR_TYPE_SIZE. (WINT_TYPE): Define in terms of WCHAR_TYPE. Co-Authored-By: Olivier Hainque <hainque@adacore.com> From-SVN: r279780
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config/vx-common.h27
2 files changed, 29 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a11d8ab..252e921 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2019-12-30 Alexandre Oliva <oliva@adacore.com>
+ Olivier Hainque <hainque@adacore.com>
+
+ * config/vx-common.h (WCHAR_TYPE_SIZE): 32 on VxWorks 7.
+ (WCHAR_TYPE): Pick accordingly.
+ (WINT_TYPE_SIZE): Define in terms of WCHAR_TYPE_SIZE.
+ (WINT_TYPE): Define in terms of WCHAR_TYPE.
+
2019-12-30 Olivier Hainque <hainque@adacore.com>
* config/vx-common.h: Minor reorganization and add
diff --git a/gcc/config/vx-common.h b/gcc/config/vx-common.h
index ed3e425..594db51 100644
--- a/gcc/config/vx-common.h
+++ b/gcc/config/vx-common.h
@@ -43,17 +43,32 @@ along with GCC; see the file COPYING3. If not see
/* ----------------------- Common type descriptions ----------------------- */
-/* VxWorks uses wchar_t == unsigned short (UCS2) on all architectures. */
+/* Regardless of the target architecture, VxWorks uses a signed 32bit
+ integer for wchar_t starting with vx7 SR06xx. An unsigned short
+ otherwise. */
+#if TARGET_VXWORKS7
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
#undef WCHAR_TYPE
-#define WCHAR_TYPE "short unsigned int"
+#define WCHAR_TYPE (TARGET_VXWORKS64 ? "int" : "long int")
+
+#else
+
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE 16
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "short unsigned int"
-/* Likewise wint_t. */
-#undef WINT_TYPE
-#define WINT_TYPE "short unsigned int"
+#endif
+
+/* The VxWorks headers base wint_t on the definitions used for wchar_t.
+ Do the same here to make sure they remain in sync, in case WCHAR_TYPE
+ gets redefined for a specific CPU architecture. */
#undef WINT_TYPE_SIZE
-#define WINT_TYPE_SIZE 16
+#define WINT_TYPE_SIZE WCHAR_TYPE_SIZE
+#undef WINT_TYPE
+#define WINT_TYPE WCHAR_TYPE
/* ---------------------- Debug and unwind info formats ------------------ */