* config/mips/iris6.h (NO_BUILTIN_WINT_TYPE): Define.
(WINT_TYPE): Override.
(WINT_TYPE_SIZE): Likewise.
(SUBTARGET_CPP_SIZE_SPEC): Define __WINT_TYPE__ as appropriate.
* config/sparc/sol2.h (WINT_TYPE): Define.
(WINT_TYPE_SIZE): Likewise.
* config/sparc/sol2-sld-64.h (NO_BUILTIN_WINT_TYPE): Define.
(WINT_TYPE): Override.
(WINT_TYPE_SIZE): Likewise.
(CPP_ARCH32_SPEC): Add __WINT_TYPE__ definition.
(CPP_ARCH64_SPEC): Likewise.
testsuite:
* gcc.dg/wchar_t-1.c: New file.
* gcc.dg/wint_t-1.c: Likewise.
From-SVN: r43216
+2001-06-11 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * config/mips/iris6.h (NO_BUILTIN_WINT_TYPE): Define.
+ (WINT_TYPE): Override.
+ (WINT_TYPE_SIZE): Likewise.
+ (SUBTARGET_CPP_SIZE_SPEC): Define __WINT_TYPE__ as appropriate.
+
+ * config/sparc/sol2.h (WINT_TYPE): Define.
+ (WINT_TYPE_SIZE): Likewise.
+
+ * config/sparc/sol2-sld-64.h (NO_BUILTIN_WINT_TYPE): Define.
+ (WINT_TYPE): Override.
+ (WINT_TYPE_SIZE): Likewise.
+ (CPP_ARCH32_SPEC): Add __WINT_TYPE__ definition.
+ (CPP_ARCH64_SPEC): Likewise.
+
2001-06-11 Richard Henderson <rth@redhat.com>
* unwind-dw2-fde.c (__deregister_frame_info): Don't play games
we avoid creating such labels. */
#define DWARF2_GENERATE_TEXT_SECTION_LABEL 0
+/* wchar_t is defined differently with and without -mabi=64. */
+
+#define NO_BUILTIN_WCHAR_TYPE
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE (Pmode == DImode ? "int" : "long int")
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
+
+/* Same for wint_t. */
+
+#define NO_BUILTIN_WINT_TYPE
+
+#undef WINT_TYPE
+#define WINT_TYPE (Pmode == DImode ? "int" : "long int")
+
+#undef WINT_TYPE_SIZE
+#define WINT_TYPE_SIZE 32
+
/* For Irix 6, -mabi=64 implies TARGET_LONG64. */
/* This is handled in override_options. */
#undef SUBTARGET_CPP_SIZE_SPEC
#define SUBTARGET_CPP_SIZE_SPEC "\
-%{mabi=32: -D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \
-%{mabi=n32: -D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \
-%{mabi=64: -D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int} \
-%{!mabi*: -D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int}"
+%{mabi=32|mabi=n32: -D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int \
+-D__WCHAR_TYPE__=long\\ int -D__WINT_TYPE__=long\\ int} \
+%{mabi=64: -D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int \
+-D__WCHAR_TYPE__=int -D__WINT_TYPE__=int} \
+%{!mabi*: -D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int \
+-D__WCHAR_TYPE__=long\\ int -D__WINT_TYPE__=long\\ int}"
/* We must make -mips3 do what -mlong64 used to do. */
/* ??? If no mipsX option given, but a mabi=X option is, then should set
%{!m32:" ASM_CPU64_DEFAULT_SPEC "} \
")
+/* wchar_t is called differently in <wchar.h> for 32 and 64-bit
+ compilations. This is called for by SCD 2.4.1, p. 6-83, Figure 6-65
+ (32-bit) and p. 6P-10, Figure 6.38 (64-bit). */
+#define NO_BUILTIN_WCHAR_TYPE
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE (TARGET_ARCH64 ? "int" : "long int")
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
+
+/* Same for wint_t. See SCD 2.4.1, p. 6-83, Figure 6-66 (32-bit). There's
+ no corresponding 64-bit definition, but this is what Solaris 8
+ <iso/wchar_iso.h> uses. */
+#define NO_BUILTIN_WINT_TYPE
+
+#undef WINT_TYPE
+#define WINT_TYPE (TARGET_ARCH64 ? "int" : "long int")
+
+#undef WINT_TYPE_SIZE
+#define WINT_TYPE_SIZE 32
+
#undef CPP_ARCH32_SPEC
#define CPP_ARCH32_SPEC "-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int \
+-D__WCHAR_TYPE__=long\\ int -D__WINT_TYPE__=long\\ int \
-D__GCC_NEW_VARARGS__ -Acpu=sparc -Amachine=sparc"
#undef CPP_ARCH64_SPEC
#define CPP_ARCH64_SPEC "-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int \
+-D__WCHAR_TYPE__=int -D__WINT_TYPE__=int \
-D__arch64__ -Acpu=sparc64 -Amachine=sparcv9 -D__sparcv9"
#undef CPP_ARCH_SPEC
/* Definitions of target machine for GNU compiler, for SPARC running Solaris 2
- Copyright 1992, 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright 1992, 1995, 1996, 1997, 1998, 1999, 2000,
+ 2001 Free Software Foundation, Inc.
Contributed by Ron Guilmette (rfg@netcom.com).
Additional changes by David V. Henkel-Wallace (gumby@cygnus.com).
/* Supposedly the same as vanilla sparc svr4, except for the stuff below: */
#include "sparc/sysv4.h"
+/* Solaris 2 uses a wint_t different from the default. This is required
+ by the SCD 2.4.1, p. 6-83, Figure 6-66. */
+#undef WINT_TYPE
+#define WINT_TYPE "long int"
+
+#undef WINT_TYPE_SIZE
+#define WINT_TYPE_SIZE BITS_PER_WORD
+
#undef CPP_PREDEFINES
#define CPP_PREDEFINES \
"-Dsparc -Dsun -Dunix -D__svr4__ -D__SVR4 \
+2001-06-11 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * gcc.dg/wchar_t-1.c: New file.
+ * gcc.dg/wint_t-1.c: Likewise.
+
2001-06-11 Bernd Schmidt <bernds@redhat.com>
* g++.old-deja/g++.other/stepanov_v1p2.C: Remove.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+
+/* Compile with -Wall to get a warning if built-in and system wchar_t don't
+ match. */
+
+#define _STDDEF_H
+#include <wchar.h>
+
+__WCHAR_TYPE__ __wc_t__;
+wchar_t *wc_t_p;
+
+void
+wct (void)
+{
+ wc_t_p = &__wc_t__;
+}
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+
+/* Compile with -Wall to get a warning if built-in and system wint_t don't
+ match. */
+
+#define _STDDEF_H
+#include <wchar.h>
+
+__WINT_TYPE__ __wi_t__;
+wint_t *wi_t_p;
+
+void
+wit (void)
+{
+ wi_t_p = &__wi_t__;
+}