1 /* Wide characters for gdb
2 Copyright (C) 2009 Free Software Foundation, Inc.
4 This file is part of GDB.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
22 /* If this host has wchar_t and if iconv is available (perhaps via GNU
23 libiconv), then we arrange to use those. Otherwise, we provide a
24 phony iconv which only handles a single character set, and we
25 provide wrappers for the wchar_t functionality we use. */
26 #if defined(HAVE_ICONV) && defined(HAVE_WCHAR_H)
32 typedef wchar_t gdb_wchar_t
;
33 typedef wint_t gdb_wint_t
;
35 #define gdb_wcslen wcslen
36 #define gdb_iswprint iswprint
37 #define gdb_iswdigit iswdigit
38 #define gdb_btowc btowc
41 #define LCST(X) L ## X
45 typedef char gdb_wchar_t
;
46 typedef int gdb_wint_t
;
48 #define gdb_wcslen strlen
49 #define gdb_iswprint isprint
50 #define gdb_iswdigit isdigit
51 #define gdb_btowc /* empty */
56 /* This define is used elsewhere so we don't need to duplicate the
57 same checking logic in multiple places. */
60 #endif /* defined(HAVE_ICONV) && defined(HAVE_WCHAR_H) */
62 #endif /* GDB_WCHAR_H */