aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorZack Weinberg <zack@wolery.cumb.org>2000-02-28 21:09:54 +0000
committerZack Weinberg <zack@gcc.gnu.org>2000-02-28 21:09:54 +0000
commit0209c3409db623d68cdb98063a40c7ea4ead7d6c (patch)
treef8b9f5609e8a8c18e6cf005e58e55445f517f8c8 /gcc
parent7cb4ce1205d29a7d8c18046f9683f08ffe539378 (diff)
downloadgcc-0209c3409db623d68cdb98063a40c7ea4ead7d6c.zip
gcc-0209c3409db623d68cdb98063a40c7ea4ead7d6c.tar.gz
gcc-0209c3409db623d68cdb98063a40c7ea4ead7d6c.tar.bz2
tm.texi: Document new target switch, NO_BUILTIN_WCHAR_TYPE.
* tm.texi: Document new target switch, NO_BUILTIN_WCHAR_TYPE. * cppinit.c (builtin_array): Define __WCHAR_TYPE__ only if NO_BUILTIN_WCHAR_TYPE is not defined. (CPP_WCHAR_TYPE): Delete. * cccp.c (main): Don't change wchar_type if cplusplus. (special_symbol, initialize_builtins): Honor NO_BUILTIN_WCHAR_TYPE. From-SVN: r32241
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/cccp.c11
-rw-r--r--gcc/cppinit.c4
-rw-r--r--gcc/tm.texi10
4 files changed, 27 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 18e6444..d307051 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2000-02-28 Zack Weinberg <zack@wolery.cumb.org>
+
+ * tm.texi: Document new target switch, NO_BUILTIN_WCHAR_TYPE.
+ * cppinit.c (builtin_array): Define __WCHAR_TYPE__ only if
+ NO_BUILTIN_WCHAR_TYPE is not defined.
+ (CPP_WCHAR_TYPE): Delete.
+ * cccp.c (main): Don't change wchar_type if cplusplus.
+ (special_symbol, initialize_builtins): Honor NO_BUILTIN_WCHAR_TYPE.
+
2000-02-28 Nick Clifton <nickc@cygnus.com>
* config/arm/arm-wince-pe.h (SIZE_TYPE): Define to "unsigned long".
diff --git a/gcc/cccp.c b/gcc/cccp.c
index 724298d..901474b 100644
--- a/gcc/cccp.c
+++ b/gcc/cccp.c
@@ -1786,11 +1786,6 @@ main (argc, argv)
fp->nominal_fname_len = strlen (in_fname);
fp->lineno = 0;
- /* In C++, wchar_t is a distinct basic type, and we can expect
- __wchar_t to be defined by cc1plus. */
- if (cplusplus)
- wchar_type = "__wchar_t";
-
/* Install __LINE__, etc. Must follow initialize_char_syntax
and option processing. */
initialize_builtins (fp, &outbuf);
@@ -4273,9 +4268,11 @@ special_symbol (hp, op)
break;
#endif
+#ifndef NO_BUILTIN_WCHAR_TYPE
case T_WCHAR_TYPE:
buf = wchar_type;
break;
+#endif
case T_USER_LABEL_PREFIX_TYPE:
buf = user_label_prefix;
@@ -10298,7 +10295,9 @@ initialize_builtins (inp, outp)
#ifndef NO_BUILTIN_PTRDIFF_TYPE
install ((const U_CHAR *) "__PTRDIFF_TYPE__ ", -1, T_PTRDIFF_TYPE, NULL_PTR, -1);
#endif
+#ifndef NO_BUILTIN_WCHAR_TYPE
install ((const U_CHAR *) "__WCHAR_TYPE__", -1, T_WCHAR_TYPE, NULL_PTR, -1);
+#endif
install ((const U_CHAR *) "__USER_LABEL_PREFIX__", -1, T_USER_LABEL_PREFIX_TYPE,
NULL_PTR, -1);
install ((const U_CHAR *) "__REGISTER_PREFIX__", -1, T_REGISTER_PREFIX_TYPE,
@@ -10347,10 +10346,12 @@ initialize_builtins (inp, outp)
outp, dp);
#endif
+#ifndef NO_BUILTIN_WCHAR_TYPE
sprintf (directive, " __WCHAR_TYPE__ %s\n", wchar_type);
output_line_directive (inp, outp, 0, same_file);
pass_thru_directive (udirective, &udirective[strlen (directive)],
outp, dp);
+#endif
sprintf (directive, " __DATE__ \"%s %2d %4d\"\n",
monthnames[timebuf->tm_mon],
diff --git a/gcc/cppinit.c b/gcc/cppinit.c
index 6c76c66..eb2124e 100644
--- a/gcc/cppinit.c
+++ b/gcc/cppinit.c
@@ -63,8 +63,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef WCHAR_TYPE
#define WCHAR_TYPE "int"
#endif
-#define CPP_WCHAR_TYPE(PFILE) \
- (CPP_OPTIONS (PFILE)->cplusplus ? "__wchar_t" : WCHAR_TYPE)
/* The string value for __USER_LABEL_PREFIX__ */
@@ -530,7 +528,9 @@ static const struct builtin builtin_array[] =
#ifndef NO_BUILTIN_PTRDIFF_TYPE
{ "__PTRDIFF_TYPE__", PTRDIFF_TYPE, T_CONST, DUMP },
#endif
+#ifndef NO_BUILTIN_WCHAR_TYPE
{ "__WCHAR_TYPE__", WCHAR_TYPE, T_CONST, DUMP },
+#endif
{ 0, 0, 0, 0 }
};
diff --git a/gcc/tm.texi b/gcc/tm.texi
index 708b8d7..3aa7646 100644
--- a/gcc/tm.texi
+++ b/gcc/tm.texi
@@ -128,6 +128,16 @@ This should be defined if @code{PTRDIFF_TYPE} depends on target dependent flags
which are not accessible to the preprocessor. Otherwise, it should not
be defined.
+@findex NO_BUILTIN_WCHAR_TYPE
+@item NO_BUILTIN_WCHAR_TYPE
+If this macro is defined, the preprocessor will not define the builtin macro
+@code{__WCHAR_TYPE__}. The macro @code{__WCHAR_TYPE__} must then be
+defined by @code{CPP_SPEC} instead.
+
+This should be defined if @code{WCHAR_TYPE} depends on target dependent flags
+which are not accessible to the preprocessor. Otherwise, it should not
+be defined.
+
@findex SIGNED_CHAR_SPEC
@item SIGNED_CHAR_SPEC
A C string constant that tells the GCC driver program options to