Skip to content

Commit

Permalink
Merge pull request cppfastio#918 from MacroModel/master
Browse files Browse the repository at this point in the history
fix msdos
  • Loading branch information
trcrsired authored Nov 11, 2024
2 parents 227e107 + 89045ad commit 841b992
Show file tree
Hide file tree
Showing 14 changed files with 1,641 additions and 247 deletions.
8 changes: 7 additions & 1 deletion include/fast_io_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ Special file type region. They are usually not used for I/O but for other purpos
However, they are still capable of doing I/O.
*/

using dir_file = directory_file_wrapper<basic_native_file<char>>;
using dir_file = directory_file_wrapper<
#if ((defined(_WIN32) || defined(__CYGWIN__)) && defined(_WIN32_WINDOWS))
win9x_dir
#else
basic_native_file<char>
#endif
>;

/*
template region
Expand Down
3 changes: 1 addition & 2 deletions include/fast_io_hosted.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,8 @@ freestanding ones.
#endif

#if !defined(__AVR__)
#if defined(__MSDOS__)
#include "fast_io_dsal/string_view.h"
#include "fast_io_dsal/string.h"
#endif
#include "fast_io_hosted/platforms/native.h"
#include "fast_io_hosted/file_loaders/impl.h"
#include "fast_io_hosted/wrapper.h"
Expand Down
21 changes: 21 additions & 0 deletions include/fast_io_hosted/file_loaders/win32_file_loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ class win32_family_file_loader
address_begin = ret.address_begin;
address_end = ret.address_end;
}
inline explicit win32_family_file_loader(win9x_fs_dirent fsdirent, open_mode om = open_mode::in,
perms pm = static_cast<perms>(436))
{
auto ret{::fast_io::win32::details::win32_load_file_impl<family>(fsdirent, om, pm)};
address_begin = ret.address_begin;
address_end = ret.address_end;
}
template <::fast_io::constructible_to_os_c_str T>
inline explicit win32_family_file_loader(T const &filename, open_mode om = open_mode::in,
perms pm = static_cast<perms>(436))
Expand All @@ -162,12 +169,26 @@ class win32_family_file_loader
address_begin = ret.address_begin;
address_end = ret.address_end;
}
template <::fast_io::constructible_to_os_c_str T>
inline explicit win32_family_file_loader(win9x_at_entry ent, T const &filename, open_mode om = open_mode::in,
perms pm = static_cast<perms>(436))
{
auto ret{::fast_io::win32::details::win32_load_file_impl<family>(ent, filename, om, pm)};
address_begin = ret.address_begin;
address_end = ret.address_end;
}
inline explicit win32_family_file_loader(win32_mmap_options const &options, nt_at_entry ent)
{
auto ret{::fast_io::win32::details::win32_load_address_options_impl<family>(options, ent.handle)};
address_begin = ret.address_begin;
address_end = ret.address_end;
}
inline explicit win32_family_file_loader(win32_mmap_options const &options, win9x_at_entry ent)
{
auto ret{::fast_io::win32::details::win32_load_address_options_impl<family>(options, ent.handle.handle)};
address_begin = ret.address_begin;
address_end = ret.address_end;
}
inline explicit win32_family_file_loader(win32_mmap_options const &options, nt_fs_dirent fsdirent,
open_mode om = open_mode::in, perms pm = static_cast<perms>(436))
{
Expand Down
Loading

0 comments on commit 841b992

Please sign in to comment.