diff --git a/.travis.yml b/.travis.yml index 724deace..a6cd8aac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/include/boost/json/detail/config.hpp b/include/boost/json/detail/config.hpp index d57b221a..f336110b 100644 --- a/include/boost/json/detail/config.hpp +++ b/include/boost/json/detail/config.hpp @@ -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__) diff --git a/include/boost/json/detail/counted_resource.hpp b/include/boost/json/detail/counted_resource.hpp index 0b6180e7..360ad65a 100644 --- a/include/boost/json/detail/counted_resource.hpp +++ b/include/boost/json/detail/counted_resource.hpp @@ -73,8 +73,4 @@ public: } // detail BOOST_JSON_NS_END -#ifdef BOOST_JSON_HEADER_ONLY -#include -#endif - #endif diff --git a/include/boost/json/detail/default_resource.hpp b/include/boost/json/detail/default_resource.hpp index 6bcbc884..7d8f421b 100644 --- a/include/boost/json/detail/default_resource.hpp +++ b/include/boost/json/detail/default_resource.hpp @@ -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 -#endif - #endif diff --git a/include/boost/json/detail/digest.hpp b/include/boost/json/detail/digest.hpp index 76a49276..88be65a4 100644 --- a/include/boost/json/detail/digest.hpp +++ b/include/boost/json/detail/digest.hpp @@ -24,8 +24,4 @@ digest( } // detail BOOST_JSON_NS_END -#ifdef BOOST_JSON_HEADER_ONLY -#include -#endif - #endif diff --git a/include/boost/json/detail/except.hpp b/include/boost/json/detail/except.hpp index 74cc92bd..1baccf59 100644 --- a/include/boost/json/detail/except.hpp +++ b/include/boost/json/detail/except.hpp @@ -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 -#endif - #endif diff --git a/include/boost/json/detail/format.hpp b/include/boost/json/detail/format.hpp index 467ff853..c9a4953e 100644 --- a/include/boost/json/detail/format.hpp +++ b/include/boost/json/detail/format.hpp @@ -39,8 +39,4 @@ format_double( } // detail BOOST_JSON_NS_END -#ifdef BOOST_JSON_HEADER_ONLY -#include -#endif - #endif diff --git a/include/boost/json/detail/impl/except.ipp b/include/boost/json/detail/impl/except.ipp index 52aec904..090d42ec 100644 --- a/include/boost/json/detail/impl/except.ipp +++ b/include/boost/json/detail/impl/except.ipp @@ -120,8 +120,4 @@ throw_system_error( } // detail BOOST_JSON_NS_END -#ifdef BOOST_JSON_HEADER_ONLY -#include -#endif - #endif diff --git a/include/boost/json/detail/raw_stack.hpp b/include/boost/json/detail/raw_stack.hpp index e4d4976f..6cb32dec 100644 --- a/include/boost/json/detail/raw_stack.hpp +++ b/include/boost/json/detail/raw_stack.hpp @@ -158,8 +158,4 @@ align_to(raw_stack& rs) noexcept } // detail BOOST_JSON_NS_END -#ifdef BOOST_JSON_HEADER_ONLY -#include -#endif - #endif diff --git a/include/boost/json/detail/ryu/ryu.hpp b/include/boost/json/detail/ryu/ryu.hpp index 4136ad09..78d2e574 100644 --- a/include/boost/json/detail/ryu/ryu.hpp +++ b/include/boost/json/detail/ryu/ryu.hpp @@ -43,8 +43,4 @@ char* d2s(double f) noexcept; } // detail BOOST_JSON_NS_END -#ifdef BOOST_JSON_HEADER_ONLY -#include -#endif - #endif diff --git a/include/boost/json/detail/stack.hpp b/include/boost/json/detail/stack.hpp index 2318a73d..353820c4 100644 --- a/include/boost/json/detail/stack.hpp +++ b/include/boost/json/detail/stack.hpp @@ -96,8 +96,4 @@ public: } // detail BOOST_JSON_NS_END -#ifdef BOOST_JSON_HEADER_ONLY -#include -#endif - #endif diff --git a/include/boost/json/detail/string_impl.hpp b/include/boost/json/detail/string_impl.hpp index 6e580f62..0ed397b8 100644 --- a/include/boost/json/detail/string_impl.hpp +++ b/include/boost/json/detail/string_impl.hpp @@ -336,8 +336,4 @@ public: } // detail BOOST_JSON_NS_END -#ifdef BOOST_JSON_HEADER_ONLY -#include -#endif - #endif diff --git a/include/boost/json/error.hpp b/include/boost/json/error.hpp index 63bad1f8..7575a522 100644 --- a/include/boost/json/error.hpp +++ b/include/boost/json/error.hpp @@ -286,8 +286,5 @@ enum class condition BOOST_JSON_NS_END #include -#ifdef BOOST_JSON_HEADER_ONLY -#include -#endif #endif diff --git a/include/boost/json/monotonic_resource.hpp b/include/boost/json/monotonic_resource.hpp index c05700d3..5bbb80aa 100644 --- a/include/boost/json/monotonic_resource.hpp +++ b/include/boost/json/monotonic_resource.hpp @@ -322,8 +322,4 @@ struct is_deallocate_trivial< BOOST_JSON_NS_END -#ifdef BOOST_JSON_HEADER_ONLY -#include -#endif - #endif diff --git a/include/boost/json/parse.hpp b/include/boost/json/parse.hpp index 1a6129b3..dce7b0da 100644 --- a/include/boost/json/parse.hpp +++ b/include/boost/json/parse.hpp @@ -103,8 +103,4 @@ parse( BOOST_JSON_NS_END -#ifdef BOOST_JSON_HEADER_ONLY -#include -#endif - #endif diff --git a/include/boost/json/parser.hpp b/include/boost/json/parser.hpp index 17bb36bb..8ead3249 100644 --- a/include/boost/json/parser.hpp +++ b/include/boost/json/parser.hpp @@ -391,8 +391,4 @@ public: BOOST_JSON_NS_END -#ifdef BOOST_JSON_HEADER_ONLY -#include -#endif - #endif diff --git a/include/boost/json/serializer.hpp b/include/boost/json/serializer.hpp index 7853f673..99693451 100644 --- a/include/boost/json/serializer.hpp +++ b/include/boost/json/serializer.hpp @@ -249,8 +249,4 @@ public: BOOST_JSON_NS_END -#ifdef BOOST_JSON_HEADER_ONLY -#include -#endif - #endif diff --git a/include/boost/json/src.hpp b/include/boost/json/src.hpp index 13b98b4a..26b7ae28 100644 --- a/include/boost/json/src.hpp +++ b/include/boost/json/src.hpp @@ -23,10 +23,6 @@ in a translation unit of the program. #include -#if defined(BOOST_JSON_HEADER_ONLY) -# error Do not compile library source with the header only macro defined -#endif - #include #include #include diff --git a/include/boost/json/static_resource.hpp b/include/boost/json/static_resource.hpp index ee607311..b6a562ba 100644 --- a/include/boost/json/static_resource.hpp +++ b/include/boost/json/static_resource.hpp @@ -236,8 +236,4 @@ struct is_deallocate_trivial< BOOST_JSON_NS_END -#ifdef BOOST_JSON_HEADER_ONLY -#include -#endif - #endif diff --git a/include/boost/json/string.hpp b/include/boost/json/string.hpp index 7e5ed42a..66949fca 100644 --- a/include/boost/json/string.hpp +++ b/include/boost/json/string.hpp @@ -2943,8 +2943,5 @@ private: #endif #include -#ifdef BOOST_JSON_HEADER_ONLY -#include -#endif #endif diff --git a/include/boost/json/to_string.hpp b/include/boost/json/to_string.hpp index 473064a3..58f31d70 100644 --- a/include/boost/json/to_string.hpp +++ b/include/boost/json/to_string.hpp @@ -60,8 +60,4 @@ operator<<( BOOST_JSON_NS_END -#ifdef BOOST_JSON_HEADER_ONLY -#include -#endif - #endif diff --git a/include/boost/json/value.hpp b/include/boost/json/value.hpp index 63db5747..298d7292 100644 --- a/include/boost/json/value.hpp +++ b/include/boost/json/value.hpp @@ -3211,19 +3211,8 @@ struct tuple_element<1, ::boost::json::key_value_pair const> #include #include -#ifdef BOOST_JSON_HEADER_ONLY -#include -#include -#include -#include -#endif - // These must come after array and object #include #include -#ifdef BOOST_JSON_HEADER_ONLY -#include -#include -#endif #endif diff --git a/include/boost/json/value_stack.hpp b/include/boost/json/value_stack.hpp index a2d66f5b..2f54e2d1 100644 --- a/include/boost/json/value_stack.hpp +++ b/include/boost/json/value_stack.hpp @@ -492,8 +492,4 @@ public: BOOST_JSON_NS_END -#ifdef BOOST_JSON_HEADER_ONLY -#include -#endif - #endif diff --git a/src/src.cpp b/src/src.cpp index 6fe1072e..11430cd1 100644 --- a/src/src.cpp +++ b/src/src.cpp @@ -7,6 +7,4 @@ // Official repository: https://github.com/cppalliance/json // -#ifndef BOOST_JSON_HEADER_ONLY #include -#endif diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 54ae81ab..ef04f134 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -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