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

Fixed class/struct mismatch and reduced symbol sizes #322

Merged
merged 2 commits into from
Jul 23, 2022
Merged
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: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
cmake_minimum_required( VERSION 3.14 )

project( "daw-json-link"
VERSION "3.0.3"
VERSION "3.0.4"
DESCRIPTION "Static JSON parsing in C++"
HOMEPAGE_URL "https://github.com/beached/daw_json_link"
LANGUAGES C CXX )
Expand Down
13 changes: 4 additions & 9 deletions include/daw/json/impl/daw_json_parse_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,6 @@ namespace daw::json {
}
};

#if not defined( _MSC_VER ) or defined( __clang__ )
template<typename ParseState, typename... JsonMembers>
inline constexpr auto
known_locations_v = make_locations_info<ParseState, JsonMembers...>( );
#endif

///
/// @brief Parse to the user supplied class. The parser will run
/// left->right if it can when the JSON document's order matches that of
Expand Down Expand Up @@ -260,11 +254,12 @@ namespace daw::json {
using NeedClassPositions = std::bool_constant<(
( JsonMembers::must_be_class_member or ... ) )>;

#if defined( _MSC_VER ) and not defined( __clang__ )
#if not defined( _MSC_VER ) or defined( __clang__ )
auto known_locations = DAW_AS_CONSTANT(
( make_locations_info<ParseState, JsonMembers...>( ) ) );
#else
auto known_locations =
make_locations_info<ParseState, JsonMembers...>( );
#else
auto known_locations = known_locations_v<ParseState, JsonMembers...>;
#endif

if constexpr( use_direct_construction_v<ParseState, JsonClass> ) {
Expand Down
2 changes: 1 addition & 1 deletion include/daw/json/impl/daw_json_value_fwd.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace daw::json {
/// @tparam ParseState see IteratorRange
template<json_options_t PolicyFlags = json_details::default_policy_flag,
typename Allocator = json_details::NoAllocator>
class basic_json_value;
struct basic_json_value;

/// @brief An untyped JSON value
using json_value = basic_json_value<>;
Expand Down
4 changes: 2 additions & 2 deletions include/daw/json/impl/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/// name.
#if not defined( DAW_JSON_VER_OVERRIDE )
// Should be updated when a potential ABI break is anticipated
#define DAW_JSON_VER v3_0_0
#define DAW_JSON_VER v3_0_4
#else
#define DAW_JSON_VER DAW_JSON_VER_OVERRIDE
#endif
Expand All @@ -36,4 +36,4 @@
#if not defined( DAW_DONT_USE_EXCEPTIONS )
#define DAW_JSON_DONT_USE_EXCEPTIONS
#endif
#endif
#endif