diff --git a/benchmark/0016.endl/u8c_file_unlocked.cc b/benchmark/0016.endl/u8c_file_unlocked.cc index 2710afbce..95c972884 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/examples/0009.filesystem/gccx86canadianfix.cc b/examples/0009.filesystem/gccx86canadianfix.cc index a8b25691c..168edfe51 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'\''`~ diff --git a/include/fast_io_core_impl/freestanding/algorithm.h b/include/fast_io_core_impl/freestanding/algorithm.h index cd64e6e0a..1d658024c 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; diff --git a/include/fast_io_core_impl/operations/writeimpl/basis.h b/include/fast_io_core_impl/operations/writeimpl/basis.h index 1f8bdfeb6..38b0645e4 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; } } @@ -421,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); @@ -448,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); diff --git a/include/fast_io_restricted.h b/include/fast_io_restricted.h new file mode 100644 index 000000000..aced89e3b --- /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 +*/ diff --git a/share/fast_io/fast_io_inc/core.inc b/share/fast_io/fast_io_inc/core.inc index 45cfd64e8..1a883ff43 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;