The header-only macro is no longer needed

fix #260
This commit is contained in:
Vinnie Falco 2020-09-06 13:40:37 -07:00
parent 847281944b
commit a182f1fe06
25 changed files with 5 additions and 106 deletions

View File

@ -275,7 +275,7 @@ jobs:
- B2_TOOLSET=gcc-8
- B2_CXXSTD=11,14
- B2_UBSAN=1
- B2_DEFINES="define=BOOST_NO_STRESS_TEST=1 define=BOOST_JSON_HEADER_ONLY=1"
- B2_DEFINES="define=BOOST_NO_STRESS_TEST=1"
- B2_LINKFLAGS="-fuse-ld=gold"
addons: *gcc-8

View File

@ -139,8 +139,6 @@
#ifndef BOOST_JSON_STANDALONE
# if defined(BOOST_JSON_DOCS)
# define BOOST_JSON_DECL
# elif defined(BOOST_JSON_HEADER_ONLY)
# define BOOST_JSON_DECL inline
# else
# if (defined(BOOST_JSON_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)) && !defined(BOOST_JSON_STATIC_LINK)
# if defined(BOOST_JSON_SOURCE)
@ -164,19 +162,14 @@
# endif
# endif
#else
# ifdef BOOST_JSON_HEADER_ONLY
# define BOOST_JSON_DECL inline
# else
# define BOOST_JSON_DECL
# ifndef BOOST_JSON_DECL
# define BOOST_JSON_DECL
# endif
#endif
#ifndef BOOST_JSON_CLASS_DECL
#define BOOST_JSON_CLASS_DECL
#endif
//#ifndef BOOST_JSON_INLINE_DECL
//#define BOOST_JSON_INLINE_DECL
//#endif
#ifndef BOOST_JSON_LIKELY
# if defined(__GNUC__) || defined(__clang__)

View File

@ -73,8 +73,4 @@ public:
} // detail
BOOST_JSON_NS_END
#ifdef BOOST_JSON_HEADER_ONLY
#include <boost/json/detail/impl/counted_resource.ipp>
#endif
#endif

View File

@ -25,9 +25,6 @@ class
: public memory_resource
{
public:
#ifdef BOOST_JSON_HEADER_ONLY
inline
#endif
~default_resource();
void*
@ -49,8 +46,4 @@ public:
} // detail
BOOST_JSON_NS_END
#ifdef BOOST_JSON_HEADER_ONLY
#include <boost/json/detail/impl/default_resource.ipp>
#endif
#endif

View File

@ -24,8 +24,4 @@ digest(
} // detail
BOOST_JSON_NS_END
#ifdef BOOST_JSON_HEADER_ONLY
#include <boost/json/detail/impl/digest.ipp>
#endif
#endif

View File

@ -40,8 +40,4 @@ BOOST_JSON_DECL void BOOST_NORETURN throw_system_error(error_code const& ec, sou
} // detail
BOOST_JSON_NS_END
#ifdef BOOST_JSON_HEADER_ONLY
#include <boost/json/detail/impl/except.ipp>
#endif
#endif

View File

@ -39,8 +39,4 @@ format_double(
} // detail
BOOST_JSON_NS_END
#ifdef BOOST_JSON_HEADER_ONLY
#include <boost/json/detail/impl/format.ipp>
#endif
#endif

View File

@ -120,8 +120,4 @@ throw_system_error(
} // detail
BOOST_JSON_NS_END
#ifdef BOOST_JSON_HEADER_ONLY
#include <boost/json/detail/impl/except.ipp>
#endif
#endif

View File

@ -158,8 +158,4 @@ align_to(raw_stack& rs) noexcept
} // detail
BOOST_JSON_NS_END
#ifdef BOOST_JSON_HEADER_ONLY
#include <boost/json/detail/impl/raw_stack.ipp>
#endif
#endif

View File

@ -43,8 +43,4 @@ char* d2s(double f) noexcept;
} // detail
BOOST_JSON_NS_END
#ifdef BOOST_JSON_HEADER_ONLY
#include <boost/json/detail/ryu/impl/d2s.ipp>
#endif
#endif

View File

@ -96,8 +96,4 @@ public:
} // detail
BOOST_JSON_NS_END
#ifdef BOOST_JSON_HEADER_ONLY
#include <boost/json/detail/impl/stack.ipp>
#endif
#endif

View File

@ -336,8 +336,4 @@ public:
} // detail
BOOST_JSON_NS_END
#ifdef BOOST_JSON_HEADER_ONLY
#include <boost/json/detail/impl/string_impl.ipp>
#endif
#endif

View File

@ -286,8 +286,5 @@ enum class condition
BOOST_JSON_NS_END
#include <boost/json/impl/error.hpp>
#ifdef BOOST_JSON_HEADER_ONLY
#include <boost/json/impl/error.ipp>
#endif
#endif

View File

@ -322,8 +322,4 @@ struct is_deallocate_trivial<
BOOST_JSON_NS_END
#ifdef BOOST_JSON_HEADER_ONLY
#include <boost/json/impl/monotonic_resource.ipp>
#endif
#endif

View File

@ -103,8 +103,4 @@ parse(
BOOST_JSON_NS_END
#ifdef BOOST_JSON_HEADER_ONLY
#include <boost/json/impl/parse.ipp>
#endif
#endif

View File

@ -391,8 +391,4 @@ public:
BOOST_JSON_NS_END
#ifdef BOOST_JSON_HEADER_ONLY
#include <boost/json/impl/parser.ipp>
#endif
#endif

View File

@ -249,8 +249,4 @@ public:
BOOST_JSON_NS_END
#ifdef BOOST_JSON_HEADER_ONLY
#include <boost/json/impl/serializer.ipp>
#endif
#endif

View File

@ -23,10 +23,6 @@ in a translation unit of the program.
#include <boost/json/detail/config.hpp>
#if defined(BOOST_JSON_HEADER_ONLY)
# error Do not compile library source with the header only macro defined
#endif
#include <boost/json/impl/array.ipp>
#include <boost/json/impl/error.ipp>
#include <boost/json/impl/monotonic_resource.ipp>

View File

@ -236,8 +236,4 @@ struct is_deallocate_trivial<
BOOST_JSON_NS_END
#ifdef BOOST_JSON_HEADER_ONLY
#include <boost/json/impl/static_resource.ipp>
#endif
#endif

View File

@ -2943,8 +2943,5 @@ private:
#endif
#include <boost/json/impl/string.hpp>
#ifdef BOOST_JSON_HEADER_ONLY
#include <boost/json/impl/string.ipp>
#endif
#endif

View File

@ -60,8 +60,4 @@ operator<<(
BOOST_JSON_NS_END
#ifdef BOOST_JSON_HEADER_ONLY
#include <boost/json/impl/to_string.ipp>
#endif
#endif

View File

@ -3211,19 +3211,8 @@ struct tuple_element<1, ::boost::json::key_value_pair const>
#include <boost/json/impl/array.hpp>
#include <boost/json/impl/object.hpp>
#ifdef BOOST_JSON_HEADER_ONLY
#include <boost/json/detail/impl/array_impl.ipp>
#include <boost/json/detail/impl/object_impl.ipp>
#include <boost/json/impl/array.ipp>
#include <boost/json/impl/object.ipp>
#endif
// These must come after array and object
#include <boost/json/impl/value.hpp>
#include <boost/json/impl/value_ref.hpp>
#ifdef BOOST_JSON_HEADER_ONLY
#include <boost/json/impl/value.ipp>
#include <boost/json/impl/value_ref.ipp>
#endif
#endif

View File

@ -492,8 +492,4 @@ public:
BOOST_JSON_NS_END
#ifdef BOOST_JSON_HEADER_ONLY
#include <boost/json/impl/value_stack.ipp>
#endif
#endif

View File

@ -7,6 +7,4 @@
// Official repository: https://github.com/cppalliance/json
//
#ifndef BOOST_JSON_HEADER_ONLY
#include <boost/json/src.hpp>
#endif

View File

@ -17,11 +17,11 @@ target_link_libraries(tests PRIVATE Boost::json)
add_test(NAME json-tests COMMAND tests)
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} PREFIX "" FILES limits.cpp main.cpp)
add_executable(limits limits.cpp main.cpp Jamfile)
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/../src PREFIX "" FILES ../src/src.cpp)
add_executable(limits limits.cpp main.cpp ../src/src.cpp Jamfile)
target_include_directories(limits PRIVATE ../include .)
target_compile_definitions(limits PRIVATE
BOOST_JSON_HEADER_ONLY=1
BOOST_JSON_MAX_STRING_SIZE=1000
BOOST_JSON_MAX_STRUCTURED_SIZE=20
BOOST_JSON_MAX_STACK_SIZE=1024