Skip to content
Merged

Next #1268

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
2 changes: 1 addition & 1 deletion benchmark/0016.endl/u8c_file_unlocked.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
4 changes: 2 additions & 2 deletions examples/0009.filesystem/gccx86canadianfix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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}`~
Expand All @@ -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'\''`~
Expand Down
4 changes: 2 additions & 2 deletions include/fast_io_core_impl/freestanding/algorithm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
18 changes: 7 additions & 11 deletions include/fast_io_core_impl/operations/writeimpl/basis.h
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,11 @@ template <typename outstmtype>
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<outstmtype>)
{
write_all_bytes_overflow_define(outsm, first, last);
Expand All @@ -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<char_type_const_ptr>(first), static_cast<::std::size_t>(itdiff), curr));
return;
}
}
Expand Down Expand Up @@ -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<outstmtype> ||
::fast_io::operations::decay::defines::has_scatter_write_all_overflow_define<outstmtype>))
{
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<char_type_const_ptr>(first)};
char_type_const_ptr lastcptr{reinterpret_cast<char_type_const_ptr>(last)};
::fast_io::details::write_all_cold_impl(outsm, firstcptr, lastcptr);
Expand All @@ -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<outstmtype> ||
::fast_io::operations::decay::defines::has_scatter_pwrite_some_overflow_define<outstmtype>))
{
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<char_type_const_ptr>(first)};
char_type_const_ptr lastcptr{reinterpret_cast<char_type_const_ptr>(last)};
::fast_io::details::pwrite_all_cold_impl(outsm, firstcptr, lastcptr);
Expand Down
7 changes: 7 additions & 0 deletions include/fast_io_restricted.h
Original file line number Diff line number Diff line change
@@ -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
*/
20 changes: 17 additions & 3 deletions share/fast_io/fast_io_inc/core.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down
Loading