diff --git a/include/fc/io/json.hpp b/include/fc/io/json.hpp index 2d1f306..f07124b 100644 --- a/include/fc/io/json.hpp +++ b/include/fc/io/json.hpp @@ -20,9 +20,11 @@ namespace fc enum parse_type { legacy_parser = 0, +#ifdef WITH_EXOTIC_JSON_PARSERS strict_parser = 1, relaxed_parser = 2, legacy_parser_with_string_doubles = 3, +#endif broken_nul_parser = 4 }; enum output_formatting diff --git a/src/io/json.cpp b/src/io/json.cpp index 2af0ab7..b9afc75 100644 --- a/src/io/json.cpp +++ b/src/io/json.cpp @@ -328,7 +328,11 @@ namespace fc if (str == "-." || str == "." || str == "-") // check the obviously wrong things we could have encountered FC_THROW_EXCEPTION(parse_error_exception, "Can't parse token \"${token}\" as a JSON numeric constant", ("token", str)); if( dot ) - return parser_type == json::legacy_parser_with_string_doubles ? variant(str) : variant(to_double(str)); + return +#ifdef WITH_EXOTIC_JSON_PARSERS + parser_type == json::legacy_parser_with_string_doubles ? variant(str) : +#endif + variant(to_double(str)); if( neg ) return to_int64(str); return to_uint64(str); @@ -760,12 +764,14 @@ namespace fc { case legacy_parser: return variant_from_stream( in, max_depth ); +#ifdef WITH_EXOTIC_JSON_PARSERS case legacy_parser_with_string_doubles: return variant_from_stream( in, max_depth ); case strict_parser: return json_relaxed::variant_from_stream( in, max_depth ); case relaxed_parser: return json_relaxed::variant_from_stream( in, max_depth ); +#endif case broken_nul_parser: return variant_from_stream( in, max_depth ); default: