Skip to content

Commit

Permalink
🛠 Fix C++20 builds (mostly?)
Browse files Browse the repository at this point in the history
— © Update copyright year
  • Loading branch information
ThePhD committed Dec 30, 2022
1 parent 9af1129 commit 12fdcf2
Show file tree
Hide file tree
Showing 544 changed files with 1,910 additions and 1,518 deletions.
4 changes: 2 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# =============================================================================
#
# ztd.text
# Copyright © 2022 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
# Copyright © 2022-2023 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
# Contact: opensource@soasis.org
#
# Commercial License Usage
Expand All @@ -17,7 +17,7 @@
# Version 2.0 (the "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
4 changes: 2 additions & 2 deletions .style.yapf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# =============================================================================
#
# ztd.text
# Copyright © 2022 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
# Copyright © 2022-2023 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
# Contact: opensource@soasis.org
#
# Commercial License Usage
Expand All @@ -18,7 +18,7 @@
# file except in compliance with the License. You may obtain a copy of the
# License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
12 changes: 10 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# =============================================================================
#
# ztd.text
# Copyright © 2022 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
# Copyright © 2022-2023 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
# Contact: opensource@soasis.org
#
# Commercial License Usage
Expand All @@ -18,7 +18,7 @@
# file except in compliance with the License. You may obtain a copy of the
# License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
Expand Down Expand Up @@ -133,6 +133,7 @@ option(ZTD_TEXT_DOCUMENTATION "Enable build of documentation" OFF)
option(ZTD_TEXT_DOCUMENTATION_NO_SPHINX "Turn off Sphinx usage (useful for ReadTheDocs builds)" OFF)
option(ZTD_TEXT_EXAMPLES "Enable build of examples" OFF)
option(ZTD_TEXT_BENCHMARKS "Enable build of benchmarks" OFF)
option(ZTD_TEXT_BENCHMARKS_INTERNALS "Enable benchmarking for basic and internal-specific functionality" OFF)
option(ZTD_TEXT_GENERATE_SINGLE "Enable generation of a single header and its target" OFF)
option(ZTD_TEXT_BOOST.TEXT "Enable usage of Boost.Text benchmarks and examples" OFF)

Expand All @@ -151,6 +152,13 @@ FetchContent_Declare(ztd.static_containers
GIT_TAG main)
FetchContent_MakeAvailable(ztd.static_containers)

# ztd.encoding_tables
FetchContent_Declare(ztd.encoding_tables
GIT_REPOSITORY https://github.com/soasis/encoding_tables.git
GIT_SHALLOW ON
GIT_TAG main)
FetchContent_MakeAvailable(ztd.encoding_tables)

# ztd.cuneicode
set(ZTD_CUNEICODE_SIMDUTF_SHARED ${ZTD_TEXT_BENCHMARKS})
FetchContent_Declare(ztd.cuneicode
Expand Down
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

ztd.text
Non-Commerical License
Copyright © 2022 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
Copyright © 2022-2023 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
Contact: opensource@soasis.org


Expand Down Expand Up @@ -68,7 +68,7 @@ END OF TERMS AND CONDITIONS

ztd.text
Commerical License Usage
Copyright © 2022 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
Copyright © 2022-2023 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
Contact: opensource@soasis.org


Expand Down
2 changes: 1 addition & 1 deletion NOTICE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ztd.text
Copyright © 2022 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
Copyright © 2022-2023 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
Contact: opensource@soasis.org

This product includes software developed at
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# =============================================================================
#
# ztd.text
# Copyright © 2022-2022 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
# Copyright © 2022-2023 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
# Contact: opensource@soasis.org
#
# Commercial License Usage
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/barrier/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# =============================================================================
#
# ztd.text
# Copyright © 2022-2022 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
# Copyright © 2022-2023 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
# Contact: opensource@soasis.org
#
# Commercial License Usage
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/barrier/include/barrier/api.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// =============================================================================
//
// ztd.idk
// Copyright © 2022 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Copyright © 2022-2023 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Contact: opensource@soasis.org
//
// Commercial License Usage
Expand All @@ -18,7 +18,7 @@
// file except in compliance with the License. You may obtain a copy of the
// License at
//
// http://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/barrier/include/barrier/barrier.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ============================================================================
//
// ztd.text
// Copyright © 2022-2022 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Copyright © 2022-2023 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Contact: opensource@soasis.org
//
// Commercial License Usage
Expand All @@ -17,7 +17,7 @@
// Version 2.0 (the "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/barrier/include/barrier/convert.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ============================================================================
//
// ztd.text
// Copyright © 2022-2022 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Copyright © 2022-2023 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Contact: opensource@soasis.org
//
// Commercial License Usage
Expand All @@ -17,7 +17,7 @@
// Version 2.0 (the "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/barrier/include/barrier/data.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ============================================================================
//
// ztd.text
// Copyright © 2022-2022 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Copyright © 2022-2023 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Contact: opensource@soasis.org
//
// Commercial License Usage
Expand All @@ -17,7 +17,7 @@
// Version 2.0 (the "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/barrier/include/barrier/version.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ============================================================================
//
// ztd.text
// Copyright © 2022-2022 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Copyright © 2022-2023 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Contact: opensource@soasis.org
//
// Commercial License Usage
Expand All @@ -17,7 +17,7 @@
// Version 2.0 (the "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/barrier/source/convert.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ============================================================================
//
// ztd.text
// Copyright © 2022-2022 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Copyright © 2022-2023 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Contact: opensource@soasis.org
//
// Commercial License Usage
Expand All @@ -17,7 +17,7 @@
// Version 2.0 (the "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/barrier/source/data.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ============================================================================
//
// ztd.text
// Copyright © 2022-2022 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Copyright © 2022-2023 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Contact: opensource@soasis.org
//
// Commercial License Usage
Expand All @@ -17,7 +17,7 @@
// Version 2.0 (the "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
9 changes: 7 additions & 2 deletions benchmarks/conversion_speed/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# =============================================================================
#
# ztd.text
# Copyright © 2022 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
# Copyright © 2022-2023 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
# Contact: opensource@soasis.org
#
# Commercial License Usage
Expand All @@ -18,7 +18,7 @@
# file except in compliance with the License. You may obtain a copy of the
# License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
Expand Down Expand Up @@ -76,6 +76,8 @@ function (generate_converion_speed_benchmark_targets name data_name title)
ZTD_TEXT_BENCHMARKS_CONVERSION_SPEED_BOOST_TEXT_BENCHMARKS=$<IF:$<BOOL:${ZTD_TEXT_BOOST.TEXT}>,1,0>
ZTD_TEXT_BENCHMARKS_CONVERSION_SPEED_ZTD_TEXT_BENCHMARKS=1
ZTD_TEXT_BENCHMARKS_CONVERSION_SPEED_ZTD_TEXT_UNCHECKED_BENCHMARKS=1
ZTD_TEXT_BENCHMARKS_CONVERSION_SPEED_ZTD_TEXT_BASIC_BENCHMARKS=$<IF:$<BOOL:${ZTD_TEXT_BENCHMARKS_INTERNALS}>,1,0>
ZTD_TEXT_BENCHMARKS_CONVERSION_SPEED_ZTD_TEXT_BASIC_UNCHECKED_BENCHMARKS=$<IF:$<BOOL:${ZTD_TEXT_BENCHMARKS_INTERNALS}>,1,0>
ZTD_TEXT_BENCHMARKS_CONVERSION_SPEED_CUNEICODE_BENCHMARKS=1
ZTD_TEXT_BENCHMARKS_CONVERSION_SPEED_ICU_BENCHMARKS=1
ZTD_TEXT_BENCHMARKS_CONVERSION_SPEED_ICONV_BENCHMARKS=1
Expand All @@ -87,6 +89,9 @@ function (generate_converion_speed_benchmark_targets name data_name title)
ZTD_TEXT_BENCHMARKS_CONVERSION_SPEED_WINDOWS_BENCHMARKS=1
ZTD_TEXT_BENCHMARKS_CONVERSION_SPEED_UTF8CPP_BENCHMARKS=1
_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING=1
_SILENCE_CXX20_CODECVT_FACETS_DEPRECATION_WARNING=1
_SILENCE_CXX23_CODECVT_FACETS_DEPRECATION_WARNING=1
_SILENCE_CXX26_CODECVT_FACETS_DEPRECATION_WARNING=1
)
generate_target_manifest(ztd.text.benchmarks.conversion_speed.${name})
set(ZTD_TEXT_BENCHMARKS_CONVERSION_SPEED_TITLE ${title})
Expand Down
20 changes: 20 additions & 0 deletions benchmarks/conversion_speed/graph_config.in.json
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,16 @@
"pattern": "ztd_text_unbounded$",
"description": "Measures the ztd.text library conversion routine using the ztd::text::transcode function, with output bounds checking turned off."
},
{
"name": "ztd.text (basic)",
"pattern": "ztd_text_basic$",
"description": "Measures the ztd.text library conversion routine using the ztd::text::basic_transcode_into_raw function."
},
{
"name": "ztd.text (basic, unbounded)",
"pattern": "ztd_text_basic_unbounded$",
"description": "Measures the ztd.text library conversion routine using the ztd::text::basic_transcode_into_raw function, with output bounds checking turned off."
},
{
"name": "ztd.text (single loop)",
"pattern": "ztd_text_single$",
Expand All @@ -251,6 +261,16 @@
"pattern": "ztd_text_unbounded_unchecked$",
"description": "Measures the ztd.text library conversion routine using the ztd::text::transcode function, with output bounds checking turned off."
},
{
"name": "ztd.text (basic, assume valid)",
"pattern": "ztd_text_basic_unchecked$",
"description": "Measures the ztd.text library conversion routine using the ztd::text::transcode function."
},
{
"name": "ztd.text (basic, unbounded, assume valid)",
"pattern": "ztd_text_basic_unbounded_unchecked$",
"description": "Measures the ztd.text library conversion routine using the ztd::text::transcode function, with output bounds checking turned off."
},
{
"name": "ztd.text (single loop, assume valid)",
"pattern": "ztd_text_single_unchecked$",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// =============================================================================
//
// ztd.text
// Copyright © 2022 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Copyright © 2022-2023 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Contact: opensource@soasis.org
//
// Commercial License Usage
Expand All @@ -18,7 +18,7 @@
// file except in compliance with the License. You may obtain a copy of the
// License at
//
// http://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ============================================================================
//
// ztd.text
// Copyright © 2022-2022 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Copyright © 2022-2023 JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC
// Contact: opensource@soasis.org
//
// Commercial License Usage
Expand All @@ -17,7 +17,7 @@
// Version 2.0 (the "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand Down Expand Up @@ -190,8 +190,9 @@ auto text_transcode(::ztd::tag<ztd::text::utf8_t, ztd::text::utf32_t>, ztd::span
using UFromErrorHandler = ztd::remove_cvref_t<FromErrorHandler>;
using UToErrorHandler = ztd::remove_cvref_t<ToErrorHandler>;
using TranscodeResult = ztd::text::transcode_result<decltype(input), decltype(output), FromState, ToState>;
if constexpr (!ztd::text::is_ignorable_error_handler_v<UFromErrorHandler> // cf
|| !ztd::text::is_ignorable_error_handler_v<UToErrorHandler>) {
constexpr bool no_error_handling = ztd::text::is_ignorable_error_handler_v<UFromErrorHandler> // cf
&& ztd::text::is_ignorable_error_handler_v<UToErrorHandler>;
if constexpr (!no_error_handling) {
const simdutf::result validate_res
= simdutf::validate_utf8_with_errors(reinterpret_cast<const char*>(input.data()), input.size());
if (validate_res.error != simdutf::error_code::SUCCESS) {
Expand All @@ -204,7 +205,7 @@ auto text_transcode(::ztd::tag<ztd::text::utf8_t, ztd::text::utf32_t>, ztd::span
}
}
// Now, we check to make sure the size is appropriate so we do not overflow the output buffer.
// Not we don't have to do this if we have an unbounded_view type.
// Note we don't have to do this if we have an unbounded_view type.
const size_t output_count
= simdutf::utf32_length_from_utf8(reinterpret_cast<const char*>(input.data()), input.size());
if (output_count <= output.size()) {
Expand Down

0 comments on commit 12fdcf2

Please sign in to comment.