Commit c5ab7f91 by Joseph Myers Committed by Joseph Myers

stddef.h: Don't declare wint_t unless __need_wint_t.

	* ginclude/stddef.h: Don't declare wint_t unless __need_wint_t.
	* c-common.h (enum c_tree_index): Add CTI_WINT_TYPE.
	(wint_type_node): Define.
	* c-decl.c (WINT_TYPE): Define.
	(init_decl_processing): Create the wint_type_node type.
	* c-common.c (T_WI): Define.
	(print_char_table): Use T_WI for %lc format.

From-SVN: r35481
parent f1fe1ac0
2000-08-04 Joseph S. Myers <jsm28@cam.ac.uk>
* ginclude/stddef.h: Don't declare wint_t unless __need_wint_t.
* c-common.h (enum c_tree_index): Add CTI_WINT_TYPE.
(wint_type_node): Define.
* c-decl.c (WINT_TYPE): Define.
(init_decl_processing): Create the wint_type_node type.
* c-common.c (T_WI): Define.
(print_char_table): Use T_WI for %lc format.
2000-08-04 Bruce Korb <bkorb@gnu.org> 2000-08-04 Bruce Korb <bkorb@gnu.org>
* fixinc/: Verified that the MSDOS patch does not break * fixinc/: Verified that the MSDOS patch does not break
......
...@@ -1193,6 +1193,7 @@ strip_attrs (specs_attrs) ...@@ -1193,6 +1193,7 @@ strip_attrs (specs_attrs)
#define T_UC &unsigned_char_type_node #define T_UC &unsigned_char_type_node
#define T_V &void_type_node #define T_V &void_type_node
#define T_W &wchar_type_node #define T_W &wchar_type_node
#define T_WI &wint_type_node
#define T_ST &sizetype #define T_ST &sizetype
typedef struct { typedef struct {
...@@ -1229,7 +1230,7 @@ static format_char_info print_char_table[] = { ...@@ -1229,7 +1230,7 @@ static format_char_info print_char_table[] = {
/* A GNU extension. */ /* A GNU extension. */
{ "m", 0, T_V, NULL, NULL, NULL, NULL, NULL, NULL, "-wp" }, { "m", 0, T_V, NULL, NULL, NULL, NULL, NULL, NULL, "-wp" },
{ "feEgGaA", 0, T_D, NULL, NULL, NULL, NULL, T_LD, NULL, "-wp0 +#" }, { "feEgGaA", 0, T_D, NULL, NULL, NULL, NULL, T_LD, NULL, "-wp0 +#" },
{ "c", 0, T_I, NULL, NULL, T_W, NULL, NULL, NULL, "-w" }, { "c", 0, T_I, NULL, NULL, T_WI, NULL, NULL, NULL, "-w" },
{ "C", 0, T_W, NULL, NULL, NULL, NULL, NULL, NULL, "-w" }, { "C", 0, T_W, NULL, NULL, NULL, NULL, NULL, NULL, "-w" },
{ "s", 1, T_C, NULL, NULL, T_W, NULL, NULL, NULL, "-wp" }, { "s", 1, T_C, NULL, NULL, T_W, NULL, NULL, NULL, "-wp" },
{ "S", 1, T_W, NULL, NULL, NULL, NULL, NULL, NULL, "-wp" }, { "S", 1, T_W, NULL, NULL, NULL, NULL, NULL, NULL, "-wp" },
......
...@@ -91,6 +91,7 @@ enum c_tree_index ...@@ -91,6 +91,7 @@ enum c_tree_index
CTI_WCHAR_TYPE, CTI_WCHAR_TYPE,
CTI_SIGNED_WCHAR_TYPE, CTI_SIGNED_WCHAR_TYPE,
CTI_UNSIGNED_WCHAR_TYPE, CTI_UNSIGNED_WCHAR_TYPE,
CTI_WINT_TYPE,
CTI_WIDEST_INT_LIT_TYPE, CTI_WIDEST_INT_LIT_TYPE,
CTI_WIDEST_UINT_LIT_TYPE, CTI_WIDEST_UINT_LIT_TYPE,
...@@ -122,6 +123,7 @@ enum c_tree_index ...@@ -122,6 +123,7 @@ enum c_tree_index
#define wchar_type_node c_global_trees[CTI_WCHAR_TYPE] #define wchar_type_node c_global_trees[CTI_WCHAR_TYPE]
#define signed_wchar_type_node c_global_trees[CTI_SIGNED_WCHAR_TYPE] #define signed_wchar_type_node c_global_trees[CTI_SIGNED_WCHAR_TYPE]
#define unsigned_wchar_type_node c_global_trees[CTI_UNSIGNED_WCHAR_TYPE] #define unsigned_wchar_type_node c_global_trees[CTI_UNSIGNED_WCHAR_TYPE]
#define wint_type_node c_global_trees[CTI_WINT_TYPE]
#define widest_integer_literal_type_node c_global_trees[CTI_WIDEST_INT_LIT_TYPE] #define widest_integer_literal_type_node c_global_trees[CTI_WIDEST_INT_LIT_TYPE]
#define widest_unsigned_literal_type_node c_global_trees[CTI_WIDEST_UINT_LIT_TYPE] #define widest_unsigned_literal_type_node c_global_trees[CTI_WIDEST_UINT_LIT_TYPE]
......
...@@ -74,6 +74,10 @@ enum decl_context ...@@ -74,6 +74,10 @@ enum decl_context
#ifndef WCHAR_TYPE #ifndef WCHAR_TYPE
#define WCHAR_TYPE "int" #define WCHAR_TYPE "int"
#endif #endif
#ifndef WINT_TYPE
#define WINT_TYPE "unsigned int"
#endif
/* Do GC. */ /* Do GC. */
int ggc_p = 1; int ggc_p = 1;
...@@ -3037,6 +3041,8 @@ init_decl_processing () ...@@ -3037,6 +3041,8 @@ init_decl_processing ()
signed_wchar_type_node = signed_type (wchar_type_node); signed_wchar_type_node = signed_type (wchar_type_node);
unsigned_wchar_type_node = unsigned_type (wchar_type_node); unsigned_wchar_type_node = unsigned_type (wchar_type_node);
wint_type_node = TREE_TYPE (IDENTIFIER_GLOBAL_VALUE (get_identifier (WINT_TYPE)));
boolean_type_node = integer_type_node; boolean_type_node = integer_type_node;
boolean_true_node = integer_one_node; boolean_true_node = integer_one_node;
boolean_false_node = integer_zero_node; boolean_false_node = integer_zero_node;
......
...@@ -302,7 +302,7 @@ typedef __WCHAR_TYPE__ wchar_t; ...@@ -302,7 +302,7 @@ typedef __WCHAR_TYPE__ wchar_t;
#undef __need_wchar_t #undef __need_wchar_t
#endif /* _STDDEF_H or __need_wchar_t. */ #endif /* _STDDEF_H or __need_wchar_t. */
#if defined (_STDDEF_H) || defined (__need_wint_t) #if defined (__need_wint_t)
#ifndef _WINT_T #ifndef _WINT_T
#define _WINT_T #define _WINT_T
......
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