author | William Roberts <williamr@symbian.org> |
Tue, 16 Mar 2010 16:12:26 +0000 | |
branch | Symbian2 |
changeset 2 | 2fe1408b6811 |
permissions | -rw-r--r-- |
williamr@2 | 1 |
#ifndef BOOST_SERIALIZATION_FORCE_INCLUDE_HPP |
williamr@2 | 2 |
#define BOOST_SERIALIZATION_FORCE_INCLUDE_HPP |
williamr@2 | 3 |
|
williamr@2 | 4 |
// MS compatible compilers support #pragma once |
williamr@2 | 5 |
#if defined(_MSC_VER) && (_MSC_VER >= 1020) |
williamr@2 | 6 |
# pragma once |
williamr@2 | 7 |
#endif |
williamr@2 | 8 |
|
williamr@2 | 9 |
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 |
williamr@2 | 10 |
// force_include.hpp: |
williamr@2 | 11 |
|
williamr@2 | 12 |
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . |
williamr@2 | 13 |
// Use, modification and distribution is subject to the Boost Software |
williamr@2 | 14 |
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
williamr@2 | 15 |
// http://www.boost.org/LICENSE_1_0.txt) |
williamr@2 | 16 |
|
williamr@2 | 17 |
// See http://www.boost.org for updates, documentation, and revision history. |
williamr@2 | 18 |
|
williamr@2 | 19 |
// implementation of class export functionality. This is an alternative to |
williamr@2 | 20 |
// "forward declaration" method to provoke instantiation of derived classes |
williamr@2 | 21 |
// that are to be serialized through pointers. |
williamr@2 | 22 |
|
williamr@2 | 23 |
#include <boost/config.hpp> |
williamr@2 | 24 |
|
williamr@2 | 25 |
// the following help macro is to guarentee that certain coded |
williamr@2 | 26 |
// is not removed by over-eager linker optimiser. In certain cases |
williamr@2 | 27 |
// we create static objects must be created but are actually never |
williamr@2 | 28 |
// referenced - creation has a side-effect such as global registration |
williamr@2 | 29 |
// which is important to us. We make an effort to refer these objects |
williamr@2 | 30 |
// so that a smart linker won't remove them as being unreferenced. |
williamr@2 | 31 |
// In microsoft compilers, inlining the code that does the referring |
williamr@2 | 32 |
// means the code gets lost and the static object is not included |
williamr@2 | 33 |
// in the library and hence never registered. This manifests itself |
williamr@2 | 34 |
// in an ungraceful crash at runtime when (and only when) built in |
williamr@2 | 35 |
// release mode. |
williamr@2 | 36 |
|
williamr@2 | 37 |
#if defined(BOOST_HAS_DECLSPEC) && !defined(__COMO__) |
williamr@2 | 38 |
# if defined(__BORLANDC__) |
williamr@2 | 39 |
# define BOOST_DLLEXPORT __export |
williamr@2 | 40 |
# else |
williamr@2 | 41 |
# define BOOST_DLLEXPORT __declspec(dllexport) |
williamr@2 | 42 |
# endif |
williamr@2 | 43 |
#elif ! defined(_WIN32) && ! defined(_WIN64) |
williamr@2 | 44 |
# if defined(__MWERKS__) |
williamr@2 | 45 |
# // define BOOST_USED __attribute__ ((used)) |
williamr@2 | 46 |
# elif defined(__GNUC__) && (__GNUC__ >= 3) |
williamr@2 | 47 |
# define BOOST_USED __attribute__ ((used)) |
williamr@2 | 48 |
# elif defined(__INTEL_COMPILER) && (BOOST_INTEL_CXX_VERSION >= 800) |
williamr@2 | 49 |
# define BOOST_USED __attribute__ ((used)) |
williamr@2 | 50 |
# endif |
williamr@2 | 51 |
#endif |
williamr@2 | 52 |
|
williamr@2 | 53 |
#ifndef BOOST_USED |
williamr@2 | 54 |
# define BOOST_USED |
williamr@2 | 55 |
#endif |
williamr@2 | 56 |
|
williamr@2 | 57 |
#ifndef BOOST_DLLEXPORT |
williamr@2 | 58 |
# define BOOST_DLLEXPORT |
williamr@2 | 59 |
#endif |
williamr@2 | 60 |
|
williamr@2 | 61 |
#endif // BOOST_SERIALIZATION_FORCE_INCLUDE_HPP |