adjusted visibility to permit passing of tests on mingw for serialization library

This commit is contained in:
Robert Ramey
2017-10-22 11:22:45 -07:00
parent 15d8f9a59c
commit b47fccb4a4
3 changed files with 19 additions and 18 deletions

View File

@@ -109,14 +109,14 @@ BOOST_UTF8_BEGIN_NAMESPACE
#define BOOST_UTF8_DECL #define BOOST_UTF8_DECL
#endif #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 std::codecvt<wchar_t, char, std::mbstate_t>
{ {
public: public:
BOOST_UTF8_DECL explicit utf8_codecvt_facet(std::size_t no_locale_manage=0); explicit utf8_codecvt_facet(std::size_t no_locale_manage=0);
virtual ~utf8_codecvt_facet(){} virtual ~utf8_codecvt_facet(){}
protected: protected:
BOOST_UTF8_DECL virtual std::codecvt_base::result do_in( virtual std::codecvt_base::result do_in(
std::mbstate_t& state, std::mbstate_t& state,
const char * from, const char * from,
const char * from_end, const char * from_end,
@@ -126,7 +126,7 @@ protected:
wchar_t*& to_next wchar_t*& to_next
) const; ) const;
BOOST_UTF8_DECL virtual std::codecvt_base::result do_out( virtual std::codecvt_base::result do_out(
std::mbstate_t & state, std::mbstate_t & state,
const wchar_t * from, const wchar_t * from,
const wchar_t * from_end, const wchar_t * from_end,
@@ -150,11 +150,11 @@ protected:
return get_octet_count(lead_octet) - 1; 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 // How many "continuing octets" will be needed for this word
// == total octets - 1. // == 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 { virtual bool do_always_noconv() const BOOST_NOEXCEPT_OR_NOTHROW {
return false; return false;
@@ -178,7 +178,7 @@ protected:
// How many char objects can I process to get <= max_limit // How many char objects can I process to get <= max_limit
// wchar_t objects? // wchar_t objects?
BOOST_UTF8_DECL virtual int do_length( virtual int do_length(
const std::mbstate_t &, const std::mbstate_t &,
const char * from, const char * from,
const char * from_end, const char * from_end,
@@ -188,6 +188,7 @@ protected:
throw() throw()
#endif #endif
; ;
/*
virtual int do_length( virtual int do_length(
std::mbstate_t & s, std::mbstate_t & s,
const char * from, const char * from,
@@ -205,6 +206,7 @@ protected:
max_limit max_limit
); );
} }
*/
// Largest possible value do_length(state,from,from_end,1) could return. // Largest possible value do_length(state,from,from_end,1) could return.
virtual int do_max_length() const BOOST_NOEXCEPT_OR_NOTHROW { virtual int do_max_length() const BOOST_NOEXCEPT_OR_NOTHROW {
return 6; // largest UTF-8 encoding of a UCS-4 character return 6; // largest UTF-8 encoding of a UCS-4 character

View File

@@ -30,14 +30,14 @@ BOOST_UTF8_BEGIN_NAMESPACE
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// implementation for wchar_t // 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::size_t no_locale_manage
) : ) :
std::codecvt<wchar_t, char, std::mbstate_t>(no_locale_manage) std::codecvt<wchar_t, char, std::mbstate_t>(no_locale_manage)
{} {}
// Translate incoming UTF-8 into UCS-4 // 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*/, std::mbstate_t& /*state*/,
const char * from, const char * from,
const char * from_end, 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; 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*/, std::mbstate_t& /*state*/,
const wchar_t * from, const wchar_t * from,
const wchar_t * from_end, 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 // How many char objects can I process to get <= max_limit
// wchar_t objects? // wchar_t objects?
BOOST_UTF8_DECL int utf8_codecvt_facet::do_length( int utf8_codecvt_facet::do_length(
const std::mbstate_t &, const std::mbstate_t &,
const char * from, const char * from,
const char * from_end, const char * from_end,
@@ -207,7 +207,7 @@ BOOST_UTF8_DECL int utf8_codecvt_facet::do_length(
return static_cast<int>(from_next-from); return static_cast<int>(from_next-from);
} }
BOOST_UTF8_DECL unsigned int utf8_codecvt_facet::get_octet_count( unsigned int utf8_codecvt_facet::get_octet_count(
unsigned char lead_octet unsigned char lead_octet
){ ){
// if the 0-bit (MSB) is 0, then 1 character // if the 0-bit (MSB) is 0, then 1 character
@@ -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 // How many "continuing octets" will be needed for this word
// == total octets - 1. // == 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 wchar_t word
) const { ) const {
return detail::get_cont_octet_out_count_impl<sizeof(wchar_t)>(word); return detail::get_cont_octet_out_count_impl<sizeof(wchar_t)>(word);

View File

@@ -24,6 +24,5 @@ import ../../config/checks/config : requires ;
run binary_search_test.cpp ; run binary_search_test.cpp ;
run is_sorted_test.cpp ; run is_sorted_test.cpp ;
run numeric_traits_test.cpp ; run numeric_traits_test.cpp ;
run test_utf8_codecvt.cpp : : # run test_utf8_codecvt.cpp : : : [ requires std_wstreambuf ] ;
: [ requires std_wstreambuf ] run test_utf8_codecvt.cpp ;
;