Added configure tests for std::mbstate_t and/or mbstate_t. Some platforms

don't have it (VxWorks, for example).
This commit is contained in:
jez 2008-08-06 22:31:39 +01:00
parent 363a413a53
commit 812925e669
13 changed files with 58 additions and 10 deletions

View file

@ -13,6 +13,7 @@ ARABICA_HAS_LIBXML2
ARABICA_HAS_XERCES
ARABICA_USE_GARDEN
ARABICA_HAS_XML_PARSER
ARABICA_HAS_MBSTATE_T
ARABICA_HAS_STD_WSTRING
ARABICA_CHECK_CODECVT_SPECIALISATIONS
ARABICA_CHECK_SOCKETS

View file

@ -0,0 +1,23 @@
#ifndef ARABICA_MBSTATE_T
#define ARABICA_MBSTATE_T
#ifdef ARABICA_NO_STD_MBSTATE_T
#ifndef ARABICA_NO_MBSTATE_T
#include <wchar.t>
namespace std {
using ::mbstate_t;
}
#else
namespace std {
typedef struct
{
int dummy; /* So that {0} is a valid constant initializer. */
} mbstate_t;
}
#endif
#endif
#endif

View file

@ -8,6 +8,7 @@
#include <locale>
#include <SAX/ArabicaConfig.hpp>
#include <Arabica/mbstate.hpp>
#ifdef ARABICA_VS6_WORKAROUND
#include <Arabica/impl/VS6Workaround.hpp>

View file

@ -2,6 +2,7 @@
#define ARABICA_ISO88591UTF8ISO88591_CODECVT_H
#include <locale>
#include <SAX/ArabicaConfig.hpp>
#include <Arabica/mbstate.hpp>
#ifdef ARABICA_VS6_WORKAROUND
namespace std {

View file

@ -8,6 +8,7 @@
#include <locale>
#include <SAX/ArabicaConfig.hpp>
#include <Arabica/mbstate.hpp>
#ifdef ARABICA_VS6_WORKAROUND
#include <Arabica/impl/VS6Workaround.hpp>
#endif

View file

@ -9,12 +9,10 @@
// The C++ Standard (ISO/IEC 14882 to be pedantic).
//
// I got my information about UTF-8 from RFC 2044.
//
// $Id$
//---------------------------------------------------------------------------
#include <SAX/ArabicaConfig.hpp>
#include <locale>
#include <SAX/ArabicaConfig.hpp>
#include <Arabica/mbstate.hpp>
#ifndef ARABICA_NO_CODECVT_SPECIALISATIONS
#include <convert/impl/codecvt_specialisations.hpp>

View file

@ -9,7 +9,7 @@
//---------------------------------------------------------------------------
#include <SAX/ArabicaConfig.hpp>
#ifndef ARABICA_NO_WCHAR_T
#include <Arabica/mbstate.hpp>
#include <locale>
#ifndef ARABICA_NO_CODECVT_SPECIALISATIONS

View file

@ -9,7 +9,7 @@
//---------------------------------------------------------------------------
#include <SAX/ArabicaConfig.hpp>
#ifndef ARABICA_NO_WCHAR_T
#include <Arabica/mbstate.hpp>
#include <locale>
#ifndef ARABICA_NO_CODECVT_SPECIALISATIONS

View file

@ -13,7 +13,7 @@
// $Id$
//---------------------------------------------------------------------------
#include <SAX/ArabicaConfig.hpp>
#include <Arabica/mbstate.hpp>
#include <locale>
#ifndef ARABICA_NO_CODECVT_SPECIALISATIONS

View file

@ -2,6 +2,7 @@
#define ARABICA_UTF8ISO88591_CODECVT_H
#include <locale>
#include <SAX/ArabicaConfig.hpp>
#include <Arabica/mbstate.hpp>
#ifdef ARABICA_VS6_WORKAROUND
namespace std {

View file

@ -9,12 +9,11 @@
// The C++ Standard (ISO/IEC 14882 to be pedantic).
//
// I got my information about UTF-8 from RFC 2044.
//
// $Id$
//---------------------------------------------------------------------------
#include <SAX/ArabicaConfig.hpp>
#ifndef ARABICA_NO_WCHAR_T
#ifndef ARABICA_NO_WCHAR_T
#include <Arabica/mbstate.hpp>
#include <locale>
#ifndef ARABICA_NO_CODECVT_SPECIALISATIONS

View file

@ -21,6 +21,7 @@
#include <cstring>
#include <SAX/ArabicaConfig.hpp>
#include <Arabica/mbstate.hpp>
#ifdef ARABICA_VS6_WORKAROUND
#include <Arabica/impl/VS6Workaround.hpp>
#endif

22
m4/mbstate_t.m4 Normal file
View file

@ -0,0 +1,22 @@
AC_DEFUN([ARABICA_HAS_MBSTATE_T],
[
AC_MSG_CHECKING([for std::mbstate_t])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <cwchar>]],
[[std::mbstate_t mb; return sizeof(mb);]])],
[mbstate_available=yes],
[mbstate_available=no])
AC_MSG_RESULT([$mbstate_available])
if test $mbstate_available = no; then
AC_DEFINE([ARABICA_NO_STD_MBSTATE_T], ,[no std::mbstate_t])
AC_MSG_CHECKING([for mbstate_t])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <wchar.h>]],
[[mbstate_t mb; return sizeof(mb);]])],
[mbstate_available=yes],
[mbstate_available=no])
AC_MSG_RESULT([$mbstate_available])
if test $mbstate_available = no; then
AC_DEFINE([ARABICA_NO_MBSTATE_T], ,[no mbstate_t])
fi
fi
])