mirror of
https://github.com/boostorg/detail.git
synced 2025-07-31 21:04:27 +02:00
adjusted visibility to permit passing of tests on mingw for serialization library
This commit is contained in:
@@ -109,14 +109,14 @@ BOOST_UTF8_BEGIN_NAMESPACE
|
||||
#define BOOST_UTF8_DECL
|
||||
#endif
|
||||
|
||||
struct BOOST_SYMBOL_VISIBLE utf8_codecvt_facet :
|
||||
struct BOOST_UTF8_DECL utf8_codecvt_facet :
|
||||
public std::codecvt<wchar_t, char, std::mbstate_t>
|
||||
{
|
||||
public:
|
||||
BOOST_UTF8_DECL explicit utf8_codecvt_facet(std::size_t no_locale_manage=0);
|
||||
virtual ~utf8_codecvt_facet(){}
|
||||
explicit utf8_codecvt_facet(std::size_t no_locale_manage=0);
|
||||
virtual ~utf8_codecvt_facet(){}
|
||||
protected:
|
||||
BOOST_UTF8_DECL virtual std::codecvt_base::result do_in(
|
||||
virtual std::codecvt_base::result do_in(
|
||||
std::mbstate_t& state,
|
||||
const char * from,
|
||||
const char * from_end,
|
||||
@@ -126,7 +126,7 @@ protected:
|
||||
wchar_t*& to_next
|
||||
) const;
|
||||
|
||||
BOOST_UTF8_DECL virtual std::codecvt_base::result do_out(
|
||||
virtual std::codecvt_base::result do_out(
|
||||
std::mbstate_t & state,
|
||||
const wchar_t * from,
|
||||
const wchar_t * from_end,
|
||||
@@ -150,11 +150,11 @@ protected:
|
||||
return get_octet_count(lead_octet) - 1;
|
||||
}
|
||||
|
||||
BOOST_UTF8_DECL static unsigned int get_octet_count(unsigned char lead_octet);
|
||||
static unsigned int get_octet_count(unsigned char lead_octet);
|
||||
|
||||
// How many "continuing octets" will be needed for this word
|
||||
// == total octets - 1.
|
||||
BOOST_UTF8_DECL int get_cont_octet_out_count(wchar_t word) const ;
|
||||
int get_cont_octet_out_count(wchar_t word) const ;
|
||||
|
||||
virtual bool do_always_noconv() const BOOST_NOEXCEPT_OR_NOTHROW {
|
||||
return false;
|
||||
@@ -178,7 +178,7 @@ protected:
|
||||
|
||||
// How many char objects can I process to get <= max_limit
|
||||
// wchar_t objects?
|
||||
BOOST_UTF8_DECL virtual int do_length(
|
||||
virtual int do_length(
|
||||
const std::mbstate_t &,
|
||||
const char * from,
|
||||
const char * from_end,
|
||||
@@ -188,6 +188,7 @@ protected:
|
||||
throw()
|
||||
#endif
|
||||
;
|
||||
/*
|
||||
virtual int do_length(
|
||||
std::mbstate_t & s,
|
||||
const char * from,
|
||||
@@ -205,6 +206,7 @@ protected:
|
||||
max_limit
|
||||
);
|
||||
}
|
||||
*/
|
||||
// Largest possible value do_length(state,from,from_end,1) could return.
|
||||
virtual int do_max_length() const BOOST_NOEXCEPT_OR_NOTHROW {
|
||||
return 6; // largest UTF-8 encoding of a UCS-4 character
|
||||
|
@@ -30,14 +30,14 @@ BOOST_UTF8_BEGIN_NAMESPACE
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// implementation for wchar_t
|
||||
|
||||
BOOST_UTF8_DECL utf8_codecvt_facet::utf8_codecvt_facet(
|
||||
utf8_codecvt_facet::utf8_codecvt_facet(
|
||||
std::size_t no_locale_manage
|
||||
) :
|
||||
std::codecvt<wchar_t, char, std::mbstate_t>(no_locale_manage)
|
||||
{}
|
||||
|
||||
// Translate incoming UTF-8 into UCS-4
|
||||
BOOST_UTF8_DECL std::codecvt_base::result utf8_codecvt_facet::do_in(
|
||||
std::codecvt_base::result utf8_codecvt_facet::do_in(
|
||||
std::mbstate_t& /*state*/,
|
||||
const char * from,
|
||||
const char * from_end,
|
||||
@@ -114,7 +114,7 @@ BOOST_UTF8_DECL std::codecvt_base::result utf8_codecvt_facet::do_in(
|
||||
else return std::codecvt_base::partial;
|
||||
}
|
||||
|
||||
BOOST_UTF8_DECL std::codecvt_base::result utf8_codecvt_facet::do_out(
|
||||
std::codecvt_base::result utf8_codecvt_facet::do_out(
|
||||
std::mbstate_t& /*state*/,
|
||||
const wchar_t * from,
|
||||
const wchar_t * from_end,
|
||||
@@ -176,7 +176,7 @@ BOOST_UTF8_DECL std::codecvt_base::result utf8_codecvt_facet::do_out(
|
||||
|
||||
// How many char objects can I process to get <= max_limit
|
||||
// wchar_t objects?
|
||||
BOOST_UTF8_DECL int utf8_codecvt_facet::do_length(
|
||||
int utf8_codecvt_facet::do_length(
|
||||
const std::mbstate_t &,
|
||||
const char * from,
|
||||
const char * from_end,
|
||||
@@ -207,8 +207,8 @@ BOOST_UTF8_DECL int utf8_codecvt_facet::do_length(
|
||||
return static_cast<int>(from_next-from);
|
||||
}
|
||||
|
||||
BOOST_UTF8_DECL unsigned int utf8_codecvt_facet::get_octet_count(
|
||||
unsigned char lead_octet
|
||||
unsigned int utf8_codecvt_facet::get_octet_count(
|
||||
unsigned char lead_octet
|
||||
){
|
||||
// if the 0-bit (MSB) is 0, then 1 character
|
||||
if (lead_octet <= 0x7f) return 1;
|
||||
@@ -279,7 +279,7 @@ int get_cont_octet_out_count_impl<4>(wchar_t word){
|
||||
|
||||
// How many "continuing octets" will be needed for this word
|
||||
// == total octets - 1.
|
||||
BOOST_UTF8_DECL int utf8_codecvt_facet::get_cont_octet_out_count(
|
||||
int utf8_codecvt_facet::get_cont_octet_out_count(
|
||||
wchar_t word
|
||||
) const {
|
||||
return detail::get_cont_octet_out_count_impl<sizeof(wchar_t)>(word);
|
||||
|
@@ -24,6 +24,5 @@ import ../../config/checks/config : requires ;
|
||||
run binary_search_test.cpp ;
|
||||
run is_sorted_test.cpp ;
|
||||
run numeric_traits_test.cpp ;
|
||||
run test_utf8_codecvt.cpp : :
|
||||
: [ requires std_wstreambuf ]
|
||||
;
|
||||
# run test_utf8_codecvt.cpp : : : [ requires std_wstreambuf ] ;
|
||||
run test_utf8_codecvt.cpp ;
|
Reference in New Issue
Block a user