| 1 | /*
|
|---|
| 2 | * mbsupport.h --- Localize determination of whether we have multibyte stuff.
|
|---|
| 3 | */
|
|---|
| 4 |
|
|---|
| 5 | /*
|
|---|
| 6 | * Copyright (C) 2004, 2005 the Free Software Foundation, Inc.
|
|---|
| 7 | *
|
|---|
| 8 | * This file is part of GAWK, the GNU implementation of the
|
|---|
| 9 | * AWK Programming Language.
|
|---|
| 10 | *
|
|---|
| 11 | * GAWK is free software; you can redistribute it and/or modify
|
|---|
| 12 | * it under the terms of the GNU General Public License as published by
|
|---|
| 13 | * the Free Software Foundation; either version 2 of the License, or
|
|---|
| 14 | * (at your option) any later version.
|
|---|
| 15 | *
|
|---|
| 16 | * GAWK is distributed in the hope that it will be useful,
|
|---|
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 19 | * GNU General Public License for more details.
|
|---|
| 20 | *
|
|---|
| 21 | * You should have received a copy of the GNU General Public License
|
|---|
| 22 | * along with this program; if not, write to the Free Software
|
|---|
| 23 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|---|
| 24 | */
|
|---|
| 25 |
|
|---|
| 26 | /*
|
|---|
| 27 | * This file is needed because we test for i18n support in 3 different
|
|---|
| 28 | * places, and we want a consistent definition in all of them. Following
|
|---|
| 29 | * the ``Don't Repeat Yourself'' principle from "The Pragmatic Programmer",
|
|---|
| 30 | * we centralize the tests here.
|
|---|
| 31 | *
|
|---|
| 32 | * This test is the union of all the current tests.
|
|---|
| 33 | */
|
|---|
| 34 |
|
|---|
| 35 | #ifdef HAVE_STDLIB_H
|
|---|
| 36 | #include <stdlib.h>
|
|---|
| 37 | #endif
|
|---|
| 38 |
|
|---|
| 39 | #if defined(HAVE_ISWCTYPE) \
|
|---|
| 40 | && defined(HAVE_LOCALE_H) \
|
|---|
| 41 | && defined(HAVE_MBRLEN) \
|
|---|
| 42 | && defined(HAVE_MBRTOWC) \
|
|---|
| 43 | && defined(HAVE_WCHAR_H) \
|
|---|
| 44 | && defined(HAVE_WCRTOMB) \
|
|---|
| 45 | && defined(HAVE_WCSCOLL) \
|
|---|
| 46 | && defined(HAVE_WCTYPE) \
|
|---|
| 47 | && defined(HAVE_WCTYPE_H) \
|
|---|
| 48 | && defined(HAVE_WCTYPE_T) \
|
|---|
| 49 | && defined(HAVE_WINT_T) \
|
|---|
| 50 | && defined(HAVE_ISWLOWER) \
|
|---|
| 51 | && defined(HAVE_ISWUPPER) \
|
|---|
| 52 | && defined(HAVE_TOWLOWER) \
|
|---|
| 53 | && defined(HAVE_TOWUPPER) \
|
|---|
| 54 | && (defined(HAVE_STDLIB_H) && defined(MB_CUR_MAX)) \
|
|---|
| 55 | /* We can handle multibyte strings. */
|
|---|
| 56 | # define MBS_SUPPORT 1
|
|---|
| 57 | #else
|
|---|
| 58 | # undef MBS_SUPPORT
|
|---|
| 59 | #endif
|
|---|