Skip to content
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
11 changes: 8 additions & 3 deletions include/boost/json/detail/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,16 @@
# endif
#endif

#ifndef BOOST_JSON_NO_DESTROY
# if defined(__clang__) && defined(__has_cpp_attribute)
#ifndef BOOST_JSON_NO_ATTRIBUTE_NO_DESTROY
// clang, but not clang-cl
# if defined(__clang__) && !defined(_MSC_VER) && defined(__has_cpp_attribute)
# if __has_cpp_attribute(clang::no_destroy)
# define BOOST_JSON_NO_DESTROY [[clang::no_destroy]]
# define BOOST_JSON_ATTRIBUTE_NO_DESTROY [[clang::no_destroy]]
# else
# define BOOST_JSON_NO_ATTRIBUTE_NO_DESTROY
# endif
# else
# define BOOST_JSON_NO_ATTRIBUTE_NO_DESTROY
# endif
#endif

Expand Down
8 changes: 4 additions & 4 deletions include/boost/json/detail/default_resource.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ default_resource final
union holder;

#ifndef BOOST_JSON_WEAK_CONSTINIT
# ifndef BOOST_JSON_NO_DESTROY
# ifdef BOOST_JSON_NO_ATTRIBUTE_NO_DESTROY
static holder instance_;
# else
BOOST_JSON_NO_DESTROY
# else // BOOST_JSON_NO_ATTRIBUTE_NO_DESTROY
BOOST_JSON_ATTRIBUTE_NO_DESTROY
static default_resource instance_;
# endif
# endif // BOOST_JSON_NO_ATTRIBUTE_NO_DESTROY
#endif

public:
Expand Down
6 changes: 3 additions & 3 deletions include/boost/json/detail/impl/default_resource.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ namespace json {
namespace detail {

#ifndef BOOST_JSON_WEAK_CONSTINIT
# ifndef BOOST_JSON_NO_DESTROY
# ifdef BOOST_JSON_NO_ATTRIBUTE_NO_DESTROY
BOOST_JSON_REQUIRE_CONST_INIT
default_resource::holder
default_resource::instance_;
# else
# else // BOOST_JSON_NO_ATTRIBUTE_NO_DESTROY
BOOST_JSON_REQUIRE_CONST_INIT
default_resource
default_resource::instance_;
# endif
# endif // BOOST_JSON_NO_ATTRIBUTE_NO_DESTROY
#endif

// this is here so that ~memory_resource
Expand Down
Loading