X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Fgdb_wchar.h;h=4442364aec5006c889ec032235ce0f62de914494;hb=63ffd7c9131c0e9723016d33cf8d435cc508d02b;hp=e5ba4a850a4e75b7ee6a65b323807a18501c5494;hpb=716b65bf40998f09290ef4806168edb636c4bacc;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/gdb_wchar.h b/gdb/gdb_wchar.h index e5ba4a850a..4442364aec 100644 --- a/gdb/gdb_wchar.h +++ b/gdb/gdb_wchar.h @@ -1,5 +1,5 @@ /* Wide characters for gdb - Copyright (C) 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 2009-2020 Free Software Foundation, Inc. This file is part of GDB. @@ -49,18 +49,18 @@ #define PHONY_ICONV #endif +#include +#include + /* We use "btowc" as a sentinel to detect functioning wchar_t support. We check for either __STDC_ISO_10646__ or a new-enough libiconv in order to ensure we can convert to and from wchar_t. We choose libiconv version 0x108 because it is the first version with iconvlist. */ -#if defined (HAVE_ICONV) && defined (HAVE_WCHAR_H) && defined (HAVE_BTOWC) \ +#if defined (HAVE_ICONV) && defined (HAVE_BTOWC) \ && (defined (__STDC_ISO_10646__) \ || (defined (_LIBICONV_VERSION) && _LIBICONV_VERSION >= 0x108)) -#include -#include - typedef wchar_t gdb_wchar_t; typedef wint_t gdb_wint_t; @@ -78,11 +78,10 @@ typedef wint_t gdb_wint_t; iconv_open. We put the endianness into the encoding name to avoid hosts that emit a BOM when the unadorned name is used. */ #if defined (__STDC_ISO_10646__) -#if WORDS_BIGENDIAN -#define INTERMEDIATE_ENCODING "UCS-4BE" -#else -#define INTERMEDIATE_ENCODING "UCS-4LE" -#endif +#define USE_INTERMEDIATE_ENCODING_FUNCTION +#define INTERMEDIATE_ENCODING intermediate_encoding () +const char *intermediate_encoding (void); + #elif defined (_LIBICONV_VERSION) && _LIBICONV_VERSION >= 0x108 #define INTERMEDIATE_ENCODING "wchar_t" #else @@ -95,7 +94,7 @@ typedef wint_t gdb_wint_t; /* If we got here and have wchar_t support, we might be on a system with some problem. So, we just disable everything. */ -#if defined (HAVE_WCHAR_H) && defined (HAVE_BTOWC) +#if defined (HAVE_BTOWC) #define PHONY_ICONV #endif