From c74ea146bf447583d1d27f370af61b56c19adaa7 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Fri, 9 Jan 2004 21:07:26 +0000 Subject: [PATCH] =?UTF-8?q?suppress=20warnings,=20add=20missing=20thow=5Fe?= =?UTF-8?q?xception=20call=20(Lars=20Gullik=20Bj=C3=B8nnes)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [SVN r21569] --- src/exception.cpp | 13 +++++++++---- src/operations_posix_windows.cpp | 2 +- src/path_posix_windows.cpp | 16 ++++++++++------ 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/exception.cpp b/src/exception.cpp index 33250a6..63d1f55 100644 --- a/src/exception.cpp +++ b/src/exception.cpp @@ -47,10 +47,10 @@ namespace fs = boost::filesystem; namespace { +# ifdef BOOST_WINDOWS std::string system_message( int sys_err_code ) { std::string str; -# ifdef BOOST_WINDOWS LPVOID lpMsgBuf; ::FormatMessageA( FORMAT_MESSAGE_ALLOCATE_BUFFER | @@ -68,11 +68,16 @@ namespace while ( str.size() && (str[str.size()-1] == '\n' || str[str.size()-1] == '\r') ) str.erase( str.size()-1 ); -# else - str += std::strerror( errno ); -# endif return str; } +# else + std::string system_message( int ) + { + std::string str; + str += std::strerror( errno ); + return str; + } +# endif struct ec_xlate { int sys_ec; fs::error_code ec; }; const ec_xlate ec_table[] = diff --git a/src/operations_posix_windows.cpp b/src/operations_posix_windows.cpp index 4c1e9d5..6a26e9e 100644 --- a/src/operations_posix_windows.cpp +++ b/src/operations_posix_windows.cpp @@ -451,7 +451,7 @@ namespace boost const std::size_t buf_sz = 32768; boost::scoped_array buf( new char [buf_sz] ); - int infile, outfile=0; // init quiets compiler warning + int infile=0, outfile=0; // init quiets compiler warning struct stat from_stat; if ( ::stat( from_file_ph.string().c_str(), &from_stat ) != 0 diff --git a/src/path_posix_windows.cpp b/src/path_posix_windows.cpp index df1e122..ccff5bf 100644 --- a/src/path_posix_windows.cpp +++ b/src/path_posix_windows.cpp @@ -131,14 +131,17 @@ namespace boost { // name_check functions ----------------------------------------------// +# ifdef BOOST_WINDOWS BOOST_FILESYSTEM_DECL bool native( const std::string & name ) { -# ifdef BOOST_WINDOWS return windows_name( name ); -# else - return true; -# endif } +# else + BOOST_FILESYSTEM_DECL bool native( const std::string & ) + { + return true; + } +# endif BOOST_FILESYSTEM_DECL bool no_check( const std::string & ) { return true; } @@ -611,8 +614,9 @@ namespace boost { assert( new_check ); if ( !safe_to_write_check ) - throw filesystem_error( "boost::filesystem::default_name_check", - "default name check already set" ); + boost::throw_exception( + filesystem_error( "boost::filesystem::default_name_check", + "default name check already set" )); default_check = new_check; safe_to_write_check = false; }