mirror of
https://github.com/jezhiggins/arabica
synced 2025-01-30 08:38:15 +01:00
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:
parent
363a413a53
commit
812925e669
13 changed files with 58 additions and 10 deletions
|
@ -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
|
||||
|
|
23
include/Arabica/mbstate.hpp
Normal file
23
include/Arabica/mbstate.hpp
Normal 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
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
#include <locale>
|
||||
#include <SAX/ArabicaConfig.hpp>
|
||||
#include <Arabica/mbstate.hpp>
|
||||
|
||||
#ifdef ARABICA_VS6_WORKAROUND
|
||||
#include <Arabica/impl/VS6Workaround.hpp>
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
#include <locale>
|
||||
#include <SAX/ArabicaConfig.hpp>
|
||||
#include <Arabica/mbstate.hpp>
|
||||
#ifdef ARABICA_VS6_WORKAROUND
|
||||
#include <Arabica/impl/VS6Workaround.hpp>
|
||||
#endif
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
//---------------------------------------------------------------------------
|
||||
#include <SAX/ArabicaConfig.hpp>
|
||||
#ifndef ARABICA_NO_WCHAR_T
|
||||
|
||||
#include <Arabica/mbstate.hpp>
|
||||
#include <locale>
|
||||
|
||||
#ifndef ARABICA_NO_CODECVT_SPECIALISATIONS
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
//---------------------------------------------------------------------------
|
||||
#include <SAX/ArabicaConfig.hpp>
|
||||
#ifndef ARABICA_NO_WCHAR_T
|
||||
|
||||
#include <Arabica/mbstate.hpp>
|
||||
#include <locale>
|
||||
|
||||
#ifndef ARABICA_NO_CODECVT_SPECIALISATIONS
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// $Id$
|
||||
//---------------------------------------------------------------------------
|
||||
#include <SAX/ArabicaConfig.hpp>
|
||||
|
||||
#include <Arabica/mbstate.hpp>
|
||||
#include <locale>
|
||||
|
||||
#ifndef ARABICA_NO_CODECVT_SPECIALISATIONS
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
22
m4/mbstate_t.m4
Normal 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
|
||||
])
|
Loading…
Add table
Reference in a new issue