Commit 0209c340 by Zack Weinberg Committed by Zack Weinberg

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
parent 7cb4ce12
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> 2000-02-28 Nick Clifton <nickc@cygnus.com>
* config/arm/arm-wince-pe.h (SIZE_TYPE): Define to "unsigned long". * config/arm/arm-wince-pe.h (SIZE_TYPE): Define to "unsigned long".
......
...@@ -1786,11 +1786,6 @@ main (argc, argv) ...@@ -1786,11 +1786,6 @@ main (argc, argv)
fp->nominal_fname_len = strlen (in_fname); fp->nominal_fname_len = strlen (in_fname);
fp->lineno = 0; 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 /* Install __LINE__, etc. Must follow initialize_char_syntax
and option processing. */ and option processing. */
initialize_builtins (fp, &outbuf); initialize_builtins (fp, &outbuf);
...@@ -4273,9 +4268,11 @@ special_symbol (hp, op) ...@@ -4273,9 +4268,11 @@ special_symbol (hp, op)
break; break;
#endif #endif
#ifndef NO_BUILTIN_WCHAR_TYPE
case T_WCHAR_TYPE: case T_WCHAR_TYPE:
buf = wchar_type; buf = wchar_type;
break; break;
#endif
case T_USER_LABEL_PREFIX_TYPE: case T_USER_LABEL_PREFIX_TYPE:
buf = user_label_prefix; buf = user_label_prefix;
...@@ -10298,7 +10295,9 @@ initialize_builtins (inp, outp) ...@@ -10298,7 +10295,9 @@ initialize_builtins (inp, outp)
#ifndef NO_BUILTIN_PTRDIFF_TYPE #ifndef NO_BUILTIN_PTRDIFF_TYPE
install ((const U_CHAR *) "__PTRDIFF_TYPE__ ", -1, T_PTRDIFF_TYPE, NULL_PTR, -1); install ((const U_CHAR *) "__PTRDIFF_TYPE__ ", -1, T_PTRDIFF_TYPE, NULL_PTR, -1);
#endif #endif
#ifndef NO_BUILTIN_WCHAR_TYPE
install ((const U_CHAR *) "__WCHAR_TYPE__", -1, T_WCHAR_TYPE, NULL_PTR, -1); 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, install ((const U_CHAR *) "__USER_LABEL_PREFIX__", -1, T_USER_LABEL_PREFIX_TYPE,
NULL_PTR, -1); NULL_PTR, -1);
install ((const U_CHAR *) "__REGISTER_PREFIX__", -1, T_REGISTER_PREFIX_TYPE, install ((const U_CHAR *) "__REGISTER_PREFIX__", -1, T_REGISTER_PREFIX_TYPE,
...@@ -10347,10 +10346,12 @@ initialize_builtins (inp, outp) ...@@ -10347,10 +10346,12 @@ initialize_builtins (inp, outp)
outp, dp); outp, dp);
#endif #endif
#ifndef NO_BUILTIN_WCHAR_TYPE
sprintf (directive, " __WCHAR_TYPE__ %s\n", wchar_type); sprintf (directive, " __WCHAR_TYPE__ %s\n", wchar_type);
output_line_directive (inp, outp, 0, same_file); output_line_directive (inp, outp, 0, same_file);
pass_thru_directive (udirective, &udirective[strlen (directive)], pass_thru_directive (udirective, &udirective[strlen (directive)],
outp, dp); outp, dp);
#endif
sprintf (directive, " __DATE__ \"%s %2d %4d\"\n", sprintf (directive, " __DATE__ \"%s %2d %4d\"\n",
monthnames[timebuf->tm_mon], monthnames[timebuf->tm_mon],
......
...@@ -63,8 +63,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ...@@ -63,8 +63,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef WCHAR_TYPE #ifndef WCHAR_TYPE
#define WCHAR_TYPE "int" #define WCHAR_TYPE "int"
#endif #endif
#define CPP_WCHAR_TYPE(PFILE) \
(CPP_OPTIONS (PFILE)->cplusplus ? "__wchar_t" : WCHAR_TYPE)
/* The string value for __USER_LABEL_PREFIX__ */ /* The string value for __USER_LABEL_PREFIX__ */
...@@ -530,7 +528,9 @@ static const struct builtin builtin_array[] = ...@@ -530,7 +528,9 @@ static const struct builtin builtin_array[] =
#ifndef NO_BUILTIN_PTRDIFF_TYPE #ifndef NO_BUILTIN_PTRDIFF_TYPE
{ "__PTRDIFF_TYPE__", PTRDIFF_TYPE, T_CONST, DUMP }, { "__PTRDIFF_TYPE__", PTRDIFF_TYPE, T_CONST, DUMP },
#endif #endif
#ifndef NO_BUILTIN_WCHAR_TYPE
{ "__WCHAR_TYPE__", WCHAR_TYPE, T_CONST, DUMP }, { "__WCHAR_TYPE__", WCHAR_TYPE, T_CONST, DUMP },
#endif
{ 0, 0, 0, 0 } { 0, 0, 0, 0 }
}; };
......
...@@ -128,6 +128,16 @@ This should be defined if @code{PTRDIFF_TYPE} depends on target dependent flags ...@@ -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 which are not accessible to the preprocessor. Otherwise, it should not
be defined. 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 @findex SIGNED_CHAR_SPEC
@item SIGNED_CHAR_SPEC @item SIGNED_CHAR_SPEC
A C string constant that tells the GCC driver program options to A C string constant that tells the GCC driver program options to
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment