Replace xmalloc/xfree with vector in jit.c
[deliverable/binutils-gdb.git] / gdb / gdb_wchar.h
index 80c595f4aa78e5613f95616982c173fb97886994..092971ee7d90b98ee972426c34e68573454216df 100644 (file)
@@ -1,5 +1,5 @@
 /* Wide characters for gdb
-   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2009-2019 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 #define PHONY_ICONV
 #endif
 
+#include <wchar.h>
+#include <wctype.h>
+
 /* 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 0x10D because it was reported that earlier
-   versions do not always accept "wchar_t" as an encoding
-   argument.  */
-#if defined (HAVE_ICONV) && defined (HAVE_WCHAR_H) && defined (HAVE_BTOWC) \
+   libiconv version 0x108 because it is the first version with
+   iconvlist.  */
+#if defined (HAVE_ICONV) && defined (HAVE_BTOWC) \
   && (defined (__STDC_ISO_10646__) \
-      || (defined (_LIBICONV_VERSION) && _LIBICONV_VERSION >= 0x10D))
-
-#include <wchar.h>
-#include <wctype.h>
+      || (defined (_LIBICONV_VERSION) && _LIBICONV_VERSION >= 0x108))
 
 typedef wchar_t gdb_wchar_t;
 typedef wint_t gdb_wint_t;
@@ -79,12 +78,11 @@ 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
-#elif defined (_LIBICONV_VERSION) && _LIBICONV_VERSION >= 0x10D
+#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
 /* This shouldn't happen, because the earlier #if should have filtered
@@ -96,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
 
This page took 0.024016 seconds and 4 git commands to generate.