From 0b1bac88d2345fe4c3d19567c1ada54ed51ac89e Mon Sep 17 00:00:00 2001 From: trcrsired Date: Tue, 10 Feb 2026 00:30:45 +0800 Subject: [PATCH 1/6] exporting more functions --- share/fast_io/fast_io_inc/core.inc | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/share/fast_io/fast_io_inc/core.inc b/share/fast_io/fast_io_inc/core.inc index 45cfd64e..1a883ff4 100644 --- a/share/fast_io/fast_io_inc/core.inc +++ b/share/fast_io/fast_io_inc/core.inc @@ -5,7 +5,10 @@ using ::fast_io::char_literal_v; using ::fast_io::pr_rsv_size; using ::fast_io::pr_rsv_to_iterator_unchecked; +using ::fast_io::io_alias_t; +using ::fast_io::io_alias; using ::fast_io::io_alias_type_t; +using ::fast_io::io_alias_type; using ::fast_io::io_reserve_type_t; using ::fast_io::io_reserve_type; @@ -124,7 +127,7 @@ using ::fast_io::io_stream_buffer_flush_define; namespace manipulators { - + using ::fast_io::manipulators::print_alias_define; using ::fast_io::manipulators::print_reserve_size; using ::fast_io::manipulators::print_reserve_define; @@ -217,8 +220,19 @@ using ::fast_io::manipulators::strvw; namespace char_category { - using ::fast_io::char_category::is_dos_file_invalid_character; -} +using ::fast_io::char_category::is_dos_file_invalid_character; +using ::fast_io::char_category::char_category_family; +using ::fast_io::char_category::char_category_traits; +using ::fast_io::char_category::to_c_lower; +using ::fast_io::char_category::to_c_upper; +using ::fast_io::char_category::to_c_halfwidth; +namespace ranges +{ +using ::fast_io::char_category::ranges::to_c_lower; +using ::fast_io::char_category::ranges::to_c_upper; +using ::fast_io::char_category::ranges::to_c_halfwidth; +} // namespace ranges +} // namespace char_category namespace mnp = manipulators; From 75d001c6e9ae9b13533e5960cdbba60d10fafe8a Mon Sep 17 00:00:00 2001 From: trcrsired Date: Sun, 15 Mar 2026 21:21:33 +0800 Subject: [PATCH 2/6] add a placeholder for fast_io_restricted --- include/fast_io_restricted.h | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 include/fast_io_restricted.h diff --git a/include/fast_io_restricted.h b/include/fast_io_restricted.h new file mode 100644 index 00000000..aced89e3 --- /dev/null +++ b/include/fast_io_restricted.h @@ -0,0 +1,7 @@ +#pragma once +/* +fast_io_restricted is experimental to support app sandboxing cross platformly + +It is based on +PWAs: web file system access +*/ From 347d267fce02b6f91127f0932a1572543991c019 Mon Sep 17 00:00:00 2001 From: trcrsired Date: Mon, 16 Mar 2026 11:02:03 +0800 Subject: [PATCH 3/6] [skip ci] gccx86canadianfix should not change \t --- examples/0009.filesystem/gccx86canadianfix.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/0009.filesystem/gccx86canadianfix.cc b/examples/0009.filesystem/gccx86canadianfix.cc index a8b25691..168edfe5 100644 --- a/examples/0009.filesystem/gccx86canadianfix.cc +++ b/examples/0009.filesystem/gccx86canadianfix.cc @@ -50,7 +50,7 @@ int main(int argc, char **argv) $install_prog $dir/$dlname $destdir/$dlname~ chmod a+x $destdir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib $destdir/$dlname'\'' || exit \$?; + eval '\''$striplib $destdir/$dlname'\'' || exit \$?; fi' else postinstall_cmds='base_file=`basename \${file}`~ @@ -60,7 +60,7 @@ int main(int argc, char **argv) $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' fi postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ From d450d8595a1210cfd1d2692ceb10c7b27a148a7d Mon Sep 17 00:00:00 2001 From: trcrsired Date: Wed, 25 Mar 2026 03:38:24 +0800 Subject: [PATCH 4/6] placeholder implementation should be removed now since C++23 does provide those algos --- include/fast_io_core_impl/freestanding/algorithm.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/fast_io_core_impl/freestanding/algorithm.h b/include/fast_io_core_impl/freestanding/algorithm.h index cd64e6e0..1d658024 100644 --- a/include/fast_io_core_impl/freestanding/algorithm.h +++ b/include/fast_io_core_impl/freestanding/algorithm.h @@ -49,8 +49,8 @@ constexpr auto lexicographical_compare_three_way(I1 f1, I1 l1, I2 f2, I2 l2) #endif #endif -#if 0 -//__STDC_HOSTED__==1 && (!defined(_GLIBCXX_HOSTED) || _GLIBCXX_HOSTED==1) +#if 1 + namespace fast_io::freestanding { using ::std::find_if; From e8c4322b960b40be1c3888347d4641d6b81771be Mon Sep 17 00:00:00 2001 From: trcrsired Date: Wed, 25 Mar 2026 04:20:54 +0800 Subject: [PATCH 5/6] Compilation error when we have weird combos for this code --- benchmark/0016.endl/u8c_file_unlocked.cc | 2 +- include/fast_io_core_impl/operations/writeimpl/basis.h | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/benchmark/0016.endl/u8c_file_unlocked.cc b/benchmark/0016.endl/u8c_file_unlocked.cc index 2710afbc..95c97288 100644 --- a/benchmark/0016.endl/u8c_file_unlocked.cc +++ b/benchmark/0016.endl/u8c_file_unlocked.cc @@ -7,7 +7,7 @@ using namespace fast_io::io; int main() { fast_io::timer tm(u8"u8c_file_unlocked"); - fast_io::u8c_file_unlocked cf(u8"filebuf_file.txt", fast_io::open_mode::out); + fast_io::u8c_file_unlocked cf(u8"c_file_unlocked.txt", fast_io::open_mode::out); for (std::size_t i{}; i != 10000000; ++i) { print(cf, u8"Hello World\n"); diff --git a/include/fast_io_core_impl/operations/writeimpl/basis.h b/include/fast_io_core_impl/operations/writeimpl/basis.h index 1f8bdfeb..050e5720 100644 --- a/include/fast_io_core_impl/operations/writeimpl/basis.h +++ b/include/fast_io_core_impl/operations/writeimpl/basis.h @@ -341,6 +341,11 @@ template inline constexpr void write_all_bytes_cold_impl(outstmtype outsm, ::std::byte const *first, ::std::byte const *last) { using char_type = typename outstmtype::output_char_type; + using char_type_const_ptr +#if __has_cpp_attribute(__gnu__::__may_alias__) + [[__gnu__::__may_alias__]] +#endif + = char_type const *; if constexpr (::fast_io::operations::decay::defines::has_write_all_bytes_overflow_define) { write_all_bytes_overflow_define(outsm, first, last); @@ -363,7 +368,8 @@ inline constexpr void write_all_bytes_cold_impl(outstmtype outsm, ::std::byte co ::std::ptrdiff_t itdiff{last - first}; if (itdiff < bfddiff) { - obuffer_set_curr(outsm, non_overlapped_copy_n(first, static_cast<::std::size_t>(itdiff), curr)); + obuffer_set_curr(outsm, non_overlapped_copy_n( + reinterpret_cast(first), static_cast<::std::size_t>(itdiff), curr)); return; } } From 73f1bfa5506d1198fc80afe9571b75a9a5b1044f Mon Sep 17 00:00:00 2001 From: trcrsired Date: Wed, 25 Mar 2026 04:24:39 +0800 Subject: [PATCH 6/6] prevent shadowing for char_type_const_ptr --- include/fast_io_core_impl/operations/writeimpl/basis.h | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/include/fast_io_core_impl/operations/writeimpl/basis.h b/include/fast_io_core_impl/operations/writeimpl/basis.h index 050e5720..38b0645e 100644 --- a/include/fast_io_core_impl/operations/writeimpl/basis.h +++ b/include/fast_io_core_impl/operations/writeimpl/basis.h @@ -427,11 +427,6 @@ inline constexpr void write_all_bytes_cold_impl(outstmtype outsm, ::std::byte co ::fast_io::operations::decay::defines::has_scatter_write_some_overflow_define || ::fast_io::operations::decay::defines::has_scatter_write_all_overflow_define)) { - using char_type_const_ptr -#if __has_cpp_attribute(__gnu__::__may_alias__) - [[__gnu__::__may_alias__]] -#endif - = char_type const *; char_type_const_ptr firstcptr{reinterpret_cast(first)}; char_type_const_ptr lastcptr{reinterpret_cast(last)}; ::fast_io::details::write_all_cold_impl(outsm, firstcptr, lastcptr); @@ -454,11 +449,6 @@ inline constexpr void write_all_bytes_cold_impl(outstmtype outsm, ::std::byte co ::fast_io::operations::decay::defines::has_pwrite_some_overflow_define || ::fast_io::operations::decay::defines::has_scatter_pwrite_some_overflow_define)) { - using char_type_const_ptr -#if __has_cpp_attribute(__gnu__::__may_alias__) - [[__gnu__::__may_alias__]] -#endif - = char_type const *; char_type_const_ptr firstcptr{reinterpret_cast(first)}; char_type_const_ptr lastcptr{reinterpret_cast(last)}; ::fast_io::details::pwrite_all_cold_impl(outsm, firstcptr, lastcptr);