Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/visibility #10

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions build/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ project boost/serialization
: source-location ../src
: requirements
<conditional>@include-spirit
: usage-requirements # pass these requirement to dependents (i.e. users)
<link>shared:<define>BOOST_SERIALIZATION_DYN_LINK=1
;

SPIRIT_ROOT = [ modules.peek : SPIRIT_ROOT ] ;
Expand Down
21 changes: 7 additions & 14 deletions include/boost/archive/basic_binary_iprimitive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ namespace archive {
/////////////////////////////////////////////////////////////////////////////
// class binary_iarchive - read serialized objects from a input binary stream
template<class Archive, class Elem, class Tr>
class BOOST_SYMBOL_VISIBLE basic_binary_iprimitive {
class BOOST_ARCHIVE_OR_WARCHIVE_DECL basic_binary_iprimitive {
#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
friend class load_access;
protected:
Expand Down Expand Up @@ -106,25 +106,18 @@ class BOOST_SYMBOL_VISIBLE basic_binary_iprimitive {
BOOST_ASSERT(0 == i || 1 == i);
(void)i; // warning suppression for release builds.
}
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
load(std::string &s);
void load(std::string &s);
#ifndef BOOST_NO_STD_WSTRING
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
load(std::wstring &ws);
void load(std::wstring &ws);
#endif
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
load(char * t);
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
load(wchar_t * t);

BOOST_ARCHIVE_OR_WARCHIVE_DECL void
init();
BOOST_ARCHIVE_OR_WARCHIVE_DECL
void load(char * t);
void load(wchar_t * t);

void init();
basic_binary_iprimitive(
std::basic_streambuf<Elem, Tr> & sb,
bool no_codecvt
);
BOOST_ARCHIVE_OR_WARCHIVE_DECL
~basic_binary_iprimitive();
public:
// we provide an optimized load for all fundamental types
Expand Down
19 changes: 6 additions & 13 deletions include/boost/archive/basic_binary_oprimitive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ namespace archive {
// class basic_binary_oprimitive - binary output of prmitives

template<class Archive, class Elem, class Tr>
class BOOST_SYMBOL_VISIBLE basic_binary_oprimitive {
class BOOST_ARCHIVE_OR_WARCHIVE_DECL basic_binary_oprimitive {
#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
friend class save_access;
protected:
Expand Down Expand Up @@ -100,26 +100,19 @@ class BOOST_SYMBOL_VISIBLE basic_binary_oprimitive {
BOOST_ASSERT(0 == static_cast<int>(t) || 1 == static_cast<int>(t));
save_binary(& t, sizeof(t));
}
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
save(const std::string &s);
void save(const std::string &s);
#ifndef BOOST_NO_STD_WSTRING
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
save(const std::wstring &ws);
void save(const std::wstring &ws);
#endif
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
save(const char * t);
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
save(const wchar_t * t);
void save(const char * t);
void save(const wchar_t * t);

BOOST_ARCHIVE_OR_WARCHIVE_DECL void
init();
void init();

BOOST_ARCHIVE_OR_WARCHIVE_DECL
basic_binary_oprimitive(
std::basic_streambuf<Elem, Tr> & sb,
bool no_codecvt
);
BOOST_ARCHIVE_OR_WARCHIVE_DECL
~basic_binary_oprimitive();
public:

Expand Down
4 changes: 4 additions & 0 deletions include/boost/archive/detail/abi_prefix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@

// See http://www.boost.org for updates, documentation, and revision history.

#include <boost/archive/detail/visibility.hpp>
#include <boost/config/abi_prefix.hpp> // must be the last header
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable : 4251 4231 4660 4275)
#endif

#if defined(BOOST_SERIALIZATION_HAVE_PRAGMA_VISIBILITY)
# pragma GCC visibility push(hidden)
#endif
4 changes: 4 additions & 0 deletions include/boost/archive/detail/abi_suffix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

// See http://www.boost.org for updates, documentation, and revision history.

#if defined(BOOST_SERIALIZATION_HAVE_PRAGMA_VISIBILITY)
# pragma GCC visibility pop
#endif

#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
Expand Down
2 changes: 1 addition & 1 deletion include/boost/archive/detail/archive_serializer_map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
namespace boost {

namespace serialization {
class extended_type_info;
class BOOST_SERIALIZATION_DECL_FWD extended_type_info;
} // namespace serialization

namespace archive {
Expand Down
7 changes: 4 additions & 3 deletions include/boost/archive/detail/basic_iarchive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <boost/noncopyable.hpp>
#include <boost/scoped_ptr.hpp>

#include <boost/serialization/config.hpp>
#include <boost/serialization/tracking_enum.hpp>
#include <boost/archive/basic_archive.hpp>
#include <boost/archive/detail/decl.hpp>
Expand All @@ -30,15 +31,15 @@

namespace boost {
namespace serialization {
class extended_type_info;
class BOOST_SERIALIZATION_DECL_FWD extended_type_info;
} // namespace serialization

namespace archive {
namespace detail {

class basic_iarchive_impl;
class basic_iserializer;
class basic_pointer_iserializer;
class BOOST_SYMBOL_VISIBLE_FWD basic_iserializer;
class BOOST_SYMBOL_VISIBLE_FWD basic_pointer_iserializer;

//////////////////////////////////////////////////////////////////////
// class basic_iarchive - read serialized objects from a input stream
Expand Down
6 changes: 3 additions & 3 deletions include/boost/archive/detail/basic_iserializer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@

namespace boost {
namespace serialization {
class extended_type_info;
class BOOST_SERIALIZATION_DECL_FWD extended_type_info;
} // namespace serialization

// forward declarations
namespace archive {
namespace detail {

class basic_iarchive;
class basic_pointer_iserializer;
class BOOST_SYMBOL_VISIBLE_FWD basic_iarchive;
class BOOST_SYMBOL_VISIBLE_FWD basic_pointer_iserializer;

class BOOST_SYMBOL_VISIBLE basic_iserializer :
public basic_serializer
Expand Down
7 changes: 4 additions & 3 deletions include/boost/archive/detail/basic_oarchive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,22 @@
#include <boost/scoped_ptr.hpp>

#include <boost/archive/basic_archive.hpp>
#include <boost/serialization/config.hpp>
#include <boost/serialization/tracking_enum.hpp>
#include <boost/archive/detail/helper_collection.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header

namespace boost {
namespace serialization {
class extended_type_info;
class BOOST_SERIALIZATION_DECL_FWD extended_type_info;
} // namespace serialization

namespace archive {
namespace detail {

class basic_oarchive_impl;
class basic_oserializer;
class basic_pointer_oserializer;
class BOOST_SYMBOL_VISIBLE_FWD basic_oserializer;
class BOOST_SYMBOL_VISIBLE_FWD basic_pointer_oserializer;

//////////////////////////////////////////////////////////////////////
// class basic_oarchive - write serialized objects to an output stream
Expand Down
6 changes: 3 additions & 3 deletions include/boost/archive/detail/basic_oserializer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@

namespace boost {
namespace serialization {
class extended_type_info;
class BOOST_SERIALIZATION_DECL_FWD extended_type_info;
} // namespace serialization

// forward declarations
namespace archive {
namespace detail {

class basic_oarchive;
class basic_pointer_oserializer;
class BOOST_SYMBOL_VISIBLE_FWD basic_oarchive;
class BOOST_SYMBOL_VISIBLE_FWD basic_pointer_oserializer;

class BOOST_SYMBOL_VISIBLE basic_oserializer :
public basic_serializer
Expand Down
4 changes: 2 additions & 2 deletions include/boost/archive/detail/basic_pointer_iserializer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@

namespace boost {
namespace serialization {
class extended_type_info;
class BOOST_SERIALIZATION_DECL_FWD extended_type_info;
} // namespace serialization

// forward declarations
namespace archive {
namespace detail {

class basic_iarchive;
class BOOST_SYMBOL_VISIBLE_FWD basic_iarchive;
class basic_iserializer;

class BOOST_SYMBOL_VISIBLE basic_pointer_iserializer
Expand Down
4 changes: 2 additions & 2 deletions include/boost/archive/detail/basic_pointer_oserializer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@

namespace boost {
namespace serialization {
class extended_type_info;
class BOOST_SERIALIZATION_DECL_FWD extended_type_info;
} // namespace serialization

namespace archive {
namespace detail {

class basic_oarchive;
class BOOST_SYMBOL_VISIBLE_FWD basic_oarchive;
class basic_oserializer;

class BOOST_SYMBOL_VISIBLE basic_pointer_oserializer :
Expand Down
4 changes: 4 additions & 0 deletions include/boost/archive/detail/basic_serializer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#include <boost/config.hpp>
#include <boost/serialization/extended_type_info.hpp>

#include <boost/archive/detail/abi_prefix.hpp> // must be the last header

#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable : 4511 4512)
Expand Down Expand Up @@ -70,6 +72,8 @@ class basic_serializer_arg : public basic_serializer {
} // namespace archive
} // namespace boost

#include <boost/archive/detail/abi_suffix.hpp> // must be the last header

#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
Expand Down
2 changes: 1 addition & 1 deletion include/boost/archive/detail/basic_serializer_map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

namespace boost {
namespace serialization {
class extended_type_info;
class BOOST_SERIALIZATION_DECL_FWD extended_type_info;
}

namespace archive {
Expand Down
2 changes: 1 addition & 1 deletion include/boost/archive/detail/common_iarchive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace boost {
namespace archive {
namespace detail {

class extended_type_info;
class BOOST_SERIALIZATION_DECL_FWD extended_type_info;

// note: referred to as Curiously Recurring Template Patter (CRTP)
template<class Archive>
Expand Down
26 changes: 20 additions & 6 deletions include/boost/archive/detail/decl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,38 @@
// http://www.boost.org/more/separate_compilation.html

#include <boost/config.hpp>
#include <boost/archive/detail/visibility.hpp>

#define BOOST_SERIALIZATION_EXPORT BOOST_SYMBOL_EXPORT
#if defined(BOOST_SERIALIZATION_VISIBLE)
# define BOOST_SERIALIZATION_IMPORT BOOST_SERIALIZATION_VISIBLE
#elif !defined(_WIN32) && !defined(__WIN32__) && !defined(WIN32)
# define BOOST_SERIALIZATION_IMPORT BOOST_SYMBOL_IMPORT
#else
/* Windows: 'dllimport' is not strictly necessary, a symbol is imported
* if definition was built with 'dllexport'.
* Leaving off dllimport simplifies implementation of custom archives.
*/
# define BOOST_SERIALIZATION_IMPORT
#endif

#if (defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SERIALIZATION_DYN_LINK))
#if defined(BOOST_ARCHIVE_SOURCE)
#define BOOST_ARCHIVE_DECL BOOST_SYMBOL_EXPORT
#define BOOST_ARCHIVE_DECL BOOST_SERIALIZATION_EXPORT
#else
#define BOOST_ARCHIVE_DECL BOOST_SYMBOL_IMPORT
#define BOOST_ARCHIVE_DECL BOOST_SERIALIZATION_IMPORT
#endif

#if defined(BOOST_WARCHIVE_SOURCE)
#define BOOST_WARCHIVE_DECL BOOST_SYMBOL_EXPORT
#define BOOST_WARCHIVE_DECL BOOST_SERIALIZATION_EXPORT
#else
#define BOOST_WARCHIVE_DECL BOOST_SYMBOL_IMPORT
#define BOOST_WARCHIVE_DECL BOOST_SERIALIZATION_IMPORT
#endif

#if defined(BOOST_WARCHIVE_SOURCE) || defined(BOOST_ARCHIVE_SOURCE)
#define BOOST_ARCHIVE_OR_WARCHIVE_DECL BOOST_SYMBOL_EXPORT
#define BOOST_ARCHIVE_OR_WARCHIVE_DECL BOOST_SERIALIZATION_EXPORT
#else
#define BOOST_ARCHIVE_OR_WARCHIVE_DECL BOOST_SYMBOL_IMPORT
#define BOOST_ARCHIVE_OR_WARCHIVE_DECL BOOST_SERIALIZATION_IMPORT
#endif

#endif
Expand Down
8 changes: 6 additions & 2 deletions include/boost/archive/detail/iserializer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,12 @@ namespace std{

#include <boost/core/addressof.hpp>

#include <boost/archive/detail/abi_prefix.hpp> // must be the last header

namespace boost {

namespace serialization {
class extended_type_info;
class BOOST_SERIALIZATION_DECL_FWD extended_type_info;
} // namespace serialization

namespace archive {
Expand Down Expand Up @@ -125,7 +127,7 @@ class iserializer : public basic_iserializer
}
protected:
// protected constructor since it's always created by singleton
explicit iserializer() :
explicit BOOST_SERIALIZATION_PRIVATE iserializer() :
basic_iserializer(
boost::serialization::singleton<
typename
Expand Down Expand Up @@ -629,4 +631,6 @@ inline void load(Archive & ar, T &t){
} // namespace archive
} // namespace boost

#include <boost/archive/detail/abi_suffix.hpp> // must be the last header

#endif // BOOST_ARCHIVE_DETAIL_ISERIALIZER_HPP
8 changes: 6 additions & 2 deletions include/boost/archive/detail/oserializer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,12 @@

#include <boost/core/addressof.hpp>

#include <boost/archive/detail/abi_prefix.hpp> // must be the last header

namespace boost {

namespace serialization {
class extended_type_info;
class BOOST_SERIALIZATION_DECL_FWD extended_type_info;
} // namespace serialization

namespace archive {
Expand Down Expand Up @@ -108,7 +110,7 @@ class oserializer : public basic_oserializer
// private constructor to inhibit any existence other than the
// static one
public:
explicit BOOST_DLLEXPORT oserializer() :
explicit BOOST_SERIALIZATION_PRIVATE oserializer() :
basic_oserializer(
boost::serialization::singleton<
typename
Expand Down Expand Up @@ -542,4 +544,6 @@ inline void save(Archive & ar, /*const*/ T &t){
} // namespace archive
} // namespace boost

#include <boost/archive/detail/abi_suffix.hpp> // must be the last header

#endif // BOOST_ARCHIVE_OSERIALIZER_HPP
Loading