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

Use Boost.Charconv #993

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from
Draft
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
4 changes: 1 addition & 3 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ def main(ctx):
linux_cxx("TSan", "g++-12", packages="g++-12", buildscript="drone", buildtype="boost", image="cppalliance/droneubuntu2204:1", environment={'COMMENT': 'tsan', 'B2_VARIANT': 'debug', 'B2_TOOLSET': 'gcc-12', 'B2_CXXSTD': '11,14,17', 'B2_TSAN': '1', 'B2_DEFINES': 'BOOST_NO_STRESS_TEST=1'}, globalenv=globalenv, privileged=True),
linux_cxx("GDB printers", "g++-12", packages="g++-12 gdb", buildscript="drone", buildtype="boost", image="cppalliance/droneubuntu2204:1", environment={'COMMENT': 'gdb', 'B2_TOOLSET': 'gcc-12', 'B2_CXXSTD': '11,14,17', 'B2_TARGETS': 'libs/json/test//gdb-printers', 'B2_VARIANT': 'debug', 'B2_DEFINES': 'BOOST_NO_STRESS_TEST=1'}, globalenv=globalenv),
linux_cxx("gcc 4.8 C++03 (no op)", "g++-4.8", packages="g++-4.8", image=linuxglobalimage, buildtype="boost", buildscript="drone", environment={"B2_TOOLSET": "gcc-4.8", "B2_CXXSTD": "03", 'B2_SEPARATE_BOOTSTRAP': '1'}, globalenv=globalenv),
linux_cxx("gcc 4.8", "g++-4.8", packages="g++-4.8", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'B2_TOOLSET': 'gcc-4.8', 'B2_CXXSTD': '11', 'B2_SEPARATE_BOOTSTRAP': '1', 'DRONE_JOB_UUID': '0ade7c2cf9', 'B2_FLAGS': 'warnings=extra warnings-as-errors=on define=BOOST_JSON_ALLOW_DEPRECATED'}, globalenv=globalenv),
linux_cxx("gcc 4.9", "g++-4.9", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'B2_TOOLSET': 'gcc-4.9', 'B2_CXXSTD': '11', 'B2_SEPARATE_BOOTSTRAP': '1', 'DRONE_JOB_UUID': 'b1d5781111', 'B2_FLAGS': 'warnings=extra warnings-as-errors=on define=BOOST_JSON_ALLOW_DEPRECATED'}, globalenv=globalenv),
linux_cxx("gcc 5", "g++-5", packages="g++-5", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'B2_TOOLSET': 'gcc-5', 'B2_CXXSTD': '11', 'DRONE_JOB_UUID': '17ba079149'}, globalenv=globalenv),
linux_cxx("gcc 6", "g++-6", packages="g++-6", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'B2_TOOLSET': 'gcc-6', 'B2_CXXSTD': '11,14', 'DRONE_JOB_UUID': '7b52009b64'}, globalenv=globalenv),
linux_cxx("gcc 7", "g++-7", packages="g++-7", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'B2_TOOLSET': 'gcc-7', 'B2_CXXSTD': '14,17', 'DRONE_JOB_UUID': 'bd307a3ec3'}, globalenv=globalenv),
Expand All @@ -46,7 +44,7 @@ def main(ctx):
linux_cxx("gcc 14", "g++-14", packages="g++-14", buildtype="boost", buildscript="drone", image="cppalliance/droneubuntu2404:1", environment={'B2_TOOLSET': 'gcc-14', 'B2_CXXSTD': '20'}, globalenv=globalenv),
linux_cxx("Clang 3.8", "clang++-3.8", packages="clang-3.8 g++", llvm_os='xenial', llvm_ver='3.8', buildtype="boost", buildscript="drone", image="cppalliance/droneubuntu1604:1", environment={'B2_TOOLSET': 'clang-3.8', 'B2_CXXSTD': '11', 'B2_SEPARATE_BOOTSTRAP': '1', 'DRONE_JOB_UUID': 'b3f0c7f6bb'}, globalenv=globalenv),
linux_cxx("Clang 4.0", "clang++-4.0", packages="clang-4.0 libstdc++-6-dev", llvm_os="xenial", llvm_ver="4.0", buildtype="boost", buildscript="drone", image="cppalliance/droneubuntu1604:1", environment={'B2_TOOLSET': 'clang-4.0', 'B2_CXXSTD': '11,14', 'DRONE_JOB_UUID': '91032ad7bb'}, globalenv=globalenv),
linux_cxx("Clang 5.0", "clang++-5.0", packages="clang-5.0 libstdc++-7-dev", llvm_os="bionic", llvm_ver="5.0", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'B2_TOOLSET': 'clang-5.0', 'B2_CXXSTD': '11,14', 'DRONE_JOB_UUID': '472b07b9fc'}, globalenv=globalenv),
linux_cxx("Clang 5.0", "clang++-5.0", packages="clang-5.0", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'B2_TOOLSET': 'clang-5.0', 'B2_CXXSTD': '11,14', 'DRONE_JOB_UUID': '472b07b9fc', 'UBUNTU_TOOLCHAIN_DISABLE': 'true'}, globalenv=globalenv),
linux_cxx("Clang 6.0", "clang++-6.0", packages="clang-6.0 libc6-dbg libstdc++-8-dev", llvm_os="bionic", llvm_ver="6.0", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'B2_TOOLSET': 'clang-6.0', 'B2_CXXSTD': '14,17', 'B2_FLAGS': 'warnings=extra warnings-as-errors=on linkflags=-lstdc++fs', 'DRONE_JOB_UUID': '12c6fc06c9'}, globalenv=globalenv),
linux_cxx("Clang 7", "clang++-7", packages="clang-7 libstdc++-8-dev", llvm_os="bionic", llvm_ver="7", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'B2_TOOLSET': 'clang-7', 'B2_CXXSTD': '17,2a', 'B2_FLAGS': 'warnings=extra warnings-as-errors=on linkflags=-lstdc++fs', 'DRONE_JOB_UUID': 'd435a6cdd7'}, globalenv=globalenv),
linux_cxx("Clang 8", "clang++-8", packages="clang-8 libstdc++-8-dev", llvm_os="bionic", llvm_ver="8", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'B2_TOOLSET': 'clang-8', 'B2_CXXSTD': '17,2a', 'B2_FLAGS': 'warnings=extra warnings-as-errors=on linkflags=-lstdc++fs', 'DRONE_JOB_UUID': '4d134bc072'}, globalenv=globalenv),
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ function(boost_json_setup_properties target)
Boost::align
Boost::assert
Boost::config
Boost::charconv
Boost::container
Boost::container_hash
Boost::core
Expand Down
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,9 @@ in order to support both little endian and big endian platforms.
Boost.JSON has been tested with the following compilers:

* clang: 3.5, 3.6, 3.7, 3.8, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
* gcc: 4.8, 4.9, 5, 6, 7, 8, 9, 10, 11, 12
* gcc: 5, 6, 7, 8, 9, 10, 11, 12
* msvc: 14.0, 14.1, 14.2, 14.3

**Note: support for GCC 4.8 and 4.9 is deprecated and will stop in
Boost 1.88.0.**

### Supported JSON Text

The library expects input text to be encoded using UTF-8, which is a
Expand Down
1 change: 1 addition & 0 deletions build.jam
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ using boost-pretty-printers ;
constant boost_dependencies :
/boost/align//boost_align
/boost/assert//boost_assert
/boost/charconv//boost_charconv
/boost/config//boost_config
/boost/container//boost_container
/boost/container_hash//boost_container_hash
Expand Down
9 changes: 2 additions & 7 deletions build/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ import boost-pretty-printers ;
import config ;
import modules ;

# These make sure we only build on compatible C++11 or later toolchains.
obj cxx11_basic_alignas : ../check/basic_alignas.cpp ;
explicit cxx11_basic_alignas ;

rule requires ( tests + )
{
local result ;
Expand Down Expand Up @@ -70,13 +66,12 @@ project
config/cxx11_hdr_tuple
config/cxx11_template_aliases
config/cxx11_variadic_templates
# We only require limited alignas support,
# so we have to use a custom check
cxx11_basic_alignas
config/cxx11_alignas
]
<toolset>msvc:<define>_SCL_SECURE_NO_WARNINGS
: usage-requirements
<library>/boost/container//boost_container/<warnings-as-errors>off
<library>/boost/charconv//boost_charconv/<warnings-as-errors>off
<define>BOOST_JSON_NO_LIB=1
: source-location ../src
;
Expand Down
9 changes: 0 additions & 9 deletions check/basic_alignas.cpp

This file was deleted.

5 changes: 1 addition & 4 deletions doc/qbk/overview.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,9 @@ Boost.Endian] in order to support both little endian and big endian platforms.
Boost.JSON has been tested with the following compilers:

* clang: 3.8, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
* gcc: 4.8, 4.9, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
* gcc: 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
* msvc: 14.0, 14.1, 14.2, 14.3

[important Support for GCC 4.8 and 4.9 is deprecated and will stop in
Boost 1.88.0.]

[heading Supported JSON Text]

The library expects input text to be encoded using UTF-8, which is a
Expand Down
10 changes: 5 additions & 5 deletions include/boost/json/basic_parser_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <boost/json/basic_parser.hpp>
#include <boost/json/error.hpp>
#include <boost/json/detail/buffer.hpp>
#include <boost/json/detail/charconv/from_chars.hpp>
#include <boost/charconv/from_chars.hpp>
#include <boost/json/detail/sse2.hpp>
#include <boost/mp11/algorithm.hpp>
#include <boost/mp11/integral.hpp>
Expand Down Expand Up @@ -2735,11 +2735,11 @@ parse_number(const char* p,
data = num_buf_.append( begin, size );
full_size = num_buf_.size();
}
auto const err = detail::charconv::from_chars(
auto const result = charconv::from_chars_erange(
data, data + full_size, d );
BOOST_ASSERT( err.ec != std::errc::invalid_argument );
BOOST_ASSERT( err.ptr == data + full_size );
(void)err;
BOOST_ASSERT( result.ec != std::errc::invalid_argument );
BOOST_ASSERT( result.ptr == data + full_size );
(void)result;
}
else BOOST_IF_CONSTEXPR( no_parsing )
d = 0;
Expand Down
22 changes: 0 additions & 22 deletions include/boost/json/detail/charconv/chars_format.hpp

This file was deleted.

201 changes: 0 additions & 201 deletions include/boost/json/detail/charconv/detail/compute_float64.hpp

This file was deleted.

Loading
Loading