* c-common.c (c_common_init): Set options->unsigned_wchar.
* cppinit.c (cpp_create_reader): Default unsigned_wchar,
group target dependencies.
(init_builtins, cpp_handle_option): Update.
* cpplex.c (cpp_interpret_charconst): Update.
* cpplib.h (struct cpp_options): Add unsigned_wchar, rename
signed_char to unsigned_char, group target dependencies.
* defaults.h (WCHAR_UNSIGNED): Remove.
* system.h (WCHAR_UNSIGNED, MAX_CHAR_TYPE_SIZE): Poison.
config:
* freebsd.h, interix.h, alpha/freebsd.h, arm/freebsd.h,
i386/386bsd.h, i386/beos-elf.h, i386/bsd386.h, i386/cygwin.h,
i386/djgpp.h, i386/freebsd-aout.h, i386/i386-interix.h,
i386/win32.h, ia64/freebsd.h, mips/netbsd.h, rs6000/freebsd.h,
sh/elf.h, sh/sh.h, sparc/freebsd.h: Remove WCHAR_UNSIGNED.
doc:
* tm.texi: Remove MAX_CHAR_TYPE_SIZE.
From-SVN: r53271
+2002-05-07 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * c-common.c (c_common_init): Set options->unsigned_wchar.
+ * cppinit.c (cpp_create_reader): Default unsigned_wchar,
+ group target dependencies.
+ (init_builtins, cpp_handle_option): Update.
+ * cpplex.c (cpp_interpret_charconst): Update.
+ * cpplib.h (struct cpp_options): Add unsigned_wchar, rename
+ signed_char to unsigned_char, group target dependencies.
+ * defaults.h (WCHAR_UNSIGNED): Remove.
+ * system.h (WCHAR_UNSIGNED, MAX_CHAR_TYPE_SIZE): Poison.
+config:
+ * freebsd.h, interix.h, alpha/freebsd.h, arm/freebsd.h,
+ i386/386bsd.h, i386/beos-elf.h, i386/bsd386.h, i386/cygwin.h,
+ i386/djgpp.h, i386/freebsd-aout.h, i386/i386-interix.h,
+ i386/win32.h, ia64/freebsd.h, mips/netbsd.h, rs6000/freebsd.h,
+ sh/elf.h, sh/sh.h, sparc/freebsd.h: Remove WCHAR_UNSIGNED.
+doc:
+ * tm.texi: Remove MAX_CHAR_TYPE_SIZE.
+
2002-05-07 Mark Mitchell <mark@codesourcery.com>
* fixinc/inclhack.def (windiss_math1): New fix.
options->char_precision = TYPE_PRECISION (char_type_node);
options->int_precision = TYPE_PRECISION (integer_type_node);
options->wchar_precision = TYPE_PRECISION (wchar_type_node);
+ options->unsigned_wchar = TREE_UNSIGNED (wchar_type_node);
+ /* This can be uncommented when 1) This all happens before
+ cpp_post_options() (needed for __CHAR_UNSIGNED__ builtin), which
+ in turn requires wchat_type_node to be set up properly by then,
+ and 2) tradcpp is integrated, so that the preprocessors don't
+ need to handle the command-line options and the specs in gcc.c
+ can be updated.
+
+ options->unsigned_char = !flag_signed_char; */
options->warn_multichar = warn_multichar;
/* alpha.h gets this wrong for FreeBSD. We use the GCC defaults instead. */
#undef WCHAR_TYPE
-#undef WCHAR_UNSIGNED
-#define WCHAR_UNSIGNED 0
-
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE 32
/* We use the GCC defaults here. */
#undef WCHAR_TYPE
-#undef WCHAR_UNSIGNED
-#define WCHAR_UNSIGNED 0
-
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE 32
#undef WCHAR_TYPE
#define WCHAR_TYPE "int"
-#undef WCHAR_UNSIGNED
-#define WCHAR_UNSIGNED 0
-
#define MATH_LIBRARY_PROFILE "-lm_p"
/* Code generation parameters. */
#undef WCHAR_TYPE
#define WCHAR_TYPE "short unsigned int"
-#define WCHAR_UNSIGNED 1
-
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE 16
#undef WCHAR_TYPE
#define WCHAR_TYPE "short unsigned int"
-#undef WCHAR_UNSIGNED
-#define WCHAR_UNSIGNED 1
-
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE 16
#undef WCHAR_TYPE
#define WCHAR_TYPE "int"
-#undef WCHAR_UNSIGNED
-#define WCHAR_UNSIGNED 0
-
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE 32
#define SIZE_TYPE "unsigned int"
#define PTRDIFF_TYPE "int"
-#define WCHAR_UNSIGNED 1
#define WCHAR_TYPE_SIZE 16
#define WCHAR_TYPE "short unsigned int"
/* Definitions for types and sizes. Wide characters are 16-bits long so
Win32 compiler add-ons will be wide character compatible. */
-#undef WCHAR_UNSIGNED
-#define WCHAR_UNSIGNED 1
-
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE 16
#undef WCHAR_TYPE
#define WCHAR_TYPE "int"
-#define WCHAR_UNSIGNED 0
-
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE BITS_PER_WORD
#undef TARGET_CPU_DEFAULT
#define TARGET_CPU_DEFAULT 2 /* 486 */
-#define WCHAR_UNSIGNED 1
#define WCHAR_TYPE_SIZE 16
#define WCHAR_TYPE "short unsigned int"
#define SIZE_TYPE "unsigned int"
#define PTRDIFF_TYPE "int"
-#define WCHAR_UNSIGNED 1
#define WCHAR_TYPE_SIZE 16
#define WCHAR_TYPE "short unsigned int"
/* Currently we do not have the atexit() function,
We use the GCC defaults instead. */
#undef WCHAR_TYPE
-#undef WCHAR_UNSIGNED
-#define WCHAR_UNSIGNED 0
-
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE 32
#undef WCHAR_TYPE
#undef WCHAR_TYPE_SIZE
-#define WCHAR_UNSIGNED 1
#define WCHAR_TYPE "short unsigned int"
#define WCHAR_TYPE_SIZE 16
#undef WCHAR_TYPE
#define WCHAR_TYPE "int"
-#undef WCHAR_UNSIGNED
-#define WCHAR_UNSIGNED 0
-
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE 32
/* rs6000.h gets this wrong for FreeBSD. We use the GCC defaults instead. */
#undef WCHAR_TYPE
-#undef WCHAR_UNSIGNED
-#define WCHAR_UNSIGNED 0
-
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE 32
#undef SIZE_TYPE
#undef PTRDIFF_TYPE
-/* And one that is defined in sh.h and should be undefined in svr4.h... */
-#undef WCHAR_UNSIGNED
-
/* Be ELF-like. */
/* TODO: convert includes to ${tm_file} list in config.gcc. */
#include "dbxelf.h"
#define WCHAR_TYPE "short unsigned int"
#define WCHAR_TYPE_SIZE 16
-#define WCHAR_UNSIGNED 1
#define SH_ELF_WCHAR_TYPE "long int"
We use the GCC defaults instead. */
#undef WCHAR_TYPE
-#undef WCHAR_UNSIGNED
-#define WCHAR_UNSIGNED 0
-
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE 32
CPP_OPTION (pfile, tabstop) = 8;
CPP_OPTION (pfile, operator_names) = 1;
CPP_OPTION (pfile, warn_endif_labels) = 1;
-#if DEFAULT_SIGNED_CHAR
- CPP_OPTION (pfile, signed_char) = 1;
-#else
- CPP_OPTION (pfile, signed_char) = 0;
-#endif
CPP_OPTION (pfile, pending) =
(struct cpp_pending *) xcalloc (1, sizeof (struct cpp_pending));
CPP_OPTION (pfile, char_precision) = CHAR_BIT;
CPP_OPTION (pfile, wchar_precision) = CHAR_BIT * sizeof (int);
CPP_OPTION (pfile, int_precision) = CHAR_BIT * sizeof (int);
+ CPP_OPTION (pfile, unsigned_char) = !DEFAULT_SIGNED_CHAR;
+ CPP_OPTION (pfile, unsigned_wchar) = 1;
/* It's simplest to just create this struct whether or not it will
be needed. */
else if (CPP_OPTION (pfile, c99))
_cpp_define_builtin (pfile, "__STDC_VERSION__ 199901L");
- if (CPP_OPTION (pfile, signed_char) == 0)
+ if (CPP_OPTION (pfile, unsigned_char))
_cpp_define_builtin (pfile, "__CHAR_UNSIGNED__ 1");
if (CPP_OPTION (pfile, lang) == CLK_STDC89
CPP_OPTION (pfile, show_column) = 0;
break;
case OPT_fsigned_char:
- CPP_OPTION (pfile, signed_char) = 1;
+ CPP_OPTION (pfile, unsigned_char) = 0;
break;
case OPT_funsigned_char:
- CPP_OPTION (pfile, signed_char) = 0;
+ CPP_OPTION (pfile, unsigned_char) = 1;
break;
case OPT_ftabstop:
/* Silently ignore empty string, non-longs and silly values. */
{
width = CPP_OPTION (pfile, char_precision);
max_chars = CPP_OPTION (pfile, int_precision) / width;
- unsigned_p = CPP_OPTION (pfile, signed_char) == 0;
+ unsigned_p = CPP_OPTION (pfile, unsigned_char);
}
else
{
width = CPP_OPTION (pfile, wchar_precision);
max_chars = 1;
- unsigned_p = WCHAR_UNSIGNED;
+ unsigned_p = CPP_OPTION (pfile, unsigned_wchar);
}
if (width < BITS_PER_CPPCHAR_T)
/* -fleading_underscore sets this to "_". */
const char *user_label_prefix;
- /* Precision for target CPP arithmetic, target characters, target
- ints and target wide characters, respectively. */
- size_t precision, char_precision, int_precision, wchar_precision;
-
/* The language we're preprocessing. */
enum c_lang lang;
/* Non-0 means -v, so print the full set of include dirs. */
unsigned char verbose;
- /* Nonzero means chars are signed. */
- unsigned char signed_char;
-
/* Nonzero means use extra default include directories for C++. */
unsigned char cplusplus;
options. Stand-alone CPP should then bail out after option
parsing; drivers might want to continue printing help. */
unsigned char help_only;
+
+ /* Target-specific features set by the front end or client. */
+
+ /* Precision for target CPP arithmetic, target characters, target
+ ints and target wide characters, respectively. */
+ size_t precision, char_precision, int_precision, wchar_precision;
+
+ /* Nonzero means chars (wide chars) are unsigned. */
+ unsigned char unsigned_char, unsigned_wchar;
};
/* Call backs. */
#define WCHAR_TYPE_SIZE INT_TYPE_SIZE
#endif
-#ifndef WCHAR_UNSIGNED
-#define WCHAR_UNSIGNED 0
-#endif
-
#ifndef FLOAT_TYPE_SIZE
#define FLOAT_TYPE_SIZE BITS_PER_WORD
#endif
target machine. If you don't define this, the default is
@code{BITS_PER_UNIT}.
-@findex MAX_CHAR_TYPE_SIZE
-@item MAX_CHAR_TYPE_SIZE
-Maximum number for the size in bits of the type @code{char} on the
-target machine. If this is undefined, the default is
-@code{CHAR_TYPE_SIZE}. Otherwise, it is the constant value that is the
-largest value that @code{CHAR_TYPE_SIZE} can have at run-time. This is
-used in @code{cpp}.
-
@findex BOOL_TYPE_SIZE
@item BOOL_TYPE_SIZE
A C expression for the size in bits of the C++ type @code{bool} and
SET_DEFAULT_TYPE_ATTRIBUTES SET_DEFAULT_DECL_ATTRIBUTES \
MERGE_MACHINE_TYPE_ATTRIBUTES MERGE_MACHINE_DECL_ATTRIBUTES \
MD_INIT_BUILTINS MD_EXPAND_BUILTIN ASM_OUTPUT_CONSTRUCTOR \
- ASM_OUTPUT_DESTRUCTOR SIGNED_CHAR_SPEC
+ ASM_OUTPUT_DESTRUCTOR SIGNED_CHAR_SPEC MAX_CHAR_TYPE_SIZE \
+ WCHAR_UNSIGNED
/* And other obsolete target macros, or macros that used to be in target
headers and were not used, and may be obsolete or may never have