Skip to content

Commit

Permalink
Minor fixes to previous commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinH committed Nov 11, 2023
1 parent 21249ca commit 2eb45f8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion include/tao/pegtl/internal/mmap_file_posix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

namespace TAO_PEGTL_NAMESPACE::internal
{
[[nodiscard]] int file_open( const std::filesystem::path& path )
[[nodiscard]] inline int file_open( const std::filesystem::path& path )
{
errno = 0;
const int fh = ::open( path.c_str(),
Expand Down Expand Up @@ -75,6 +75,7 @@ namespace TAO_PEGTL_NAMESPACE::internal
const std::error_code ec( errno, std::system_category() );
throw std::filesystem::filesystem_error( "fstat() failed", path, ec );
#else
(void)path;
std::perror( "fstat() failed" );
std::terminate();
#endif
Expand All @@ -101,6 +102,7 @@ namespace TAO_PEGTL_NAMESPACE::internal
const std::error_code ec( errno, std::system_category() );
throw std::filesystem::filesystem_error( "mmap() failed", path, ec );
#else
(void)path;
std::perror( "mmap() failed" );
std::terminate();
#endif
Expand Down
6 changes: 4 additions & 2 deletions include/tao/pegtl/internal/mmap_file_win32.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

namespace TAO_PEGTL_NAMESPACE::internal
{
[[nodiscard]] HANDLE file_open( const std::filesystem::path& path )
[[nodiscard]] inline HANDLE file_open( const std::filesystem::path& path )
{
SetLastError( 0 );
#if( _WIN32_WINNT >= 0x0602 )
Expand Down Expand Up @@ -108,6 +108,7 @@ namespace TAO_PEGTL_NAMESPACE::internal
std::error_code ec( ::GetLastError(), std::system_category() );
throw std::filesystem::filesystem_error( "GetFileSizeEx() failed", path, ec );
#else
(void)path;
std::perror( "GetFileSizeEx() failed" );
std::terminate();
#endif
Expand All @@ -122,7 +123,7 @@ namespace TAO_PEGTL_NAMESPACE::internal
: mmap_file_mmap( path, mmap_file_open( path ) )
{}

mmap_file_mmap( cosnt std::filesystem::path& path, const mmap_file_open& file )
mmap_file_mmap( const std::filesystem::path& path, const mmap_file_open& file )
: size( file.size ),
handle( open( path, file ) )
{}
Expand Down Expand Up @@ -162,6 +163,7 @@ namespace TAO_PEGTL_NAMESPACE::internal
std::error_code ec( ::GetLastError(), std::system_category() );
throw std::filesystem::filesystem_error( "CreateFileMappingW() failed", path, ec );
#else
(void)path;
std::perror( "CreateFileMappingW() failed" );
std::terminate();
#endif
Expand Down

0 comments on commit 2eb45f8

Please sign in to comment.