|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r49099 - in branches/bcbboost/libs: exception/test filesystem/src filesystem/test regex/build system/src system/test system/test/msvc_system system/test/msvc_system/error_code_test
From: nicola.musatti_at_[hidden]
Date: 2008-10-01 18:38:45
Author: nmusatti
Date: 2008-10-01 18:38:45 EDT (Wed, 01 Oct 2008)
New Revision: 49099
URL: http://svn.boost.org/trac/boost/changeset/49099
Log:
Merge from trunk
Added:
branches/bcbboost/libs/system/test/msvc_system/
- copied from r49097, /trunk/libs/system/test/msvc_system/
branches/bcbboost/libs/system/test/msvc_system/common.vsprops
- copied unchanged from r49097, /trunk/libs/system/test/msvc_system/common.vsprops
branches/bcbboost/libs/system/test/msvc_system/error_code_test/
- copied from r49097, /trunk/libs/system/test/msvc_system/error_code_test/
branches/bcbboost/libs/system/test/msvc_system/error_code_test/error_code_test.vcproj
- copied unchanged from r49097, /trunk/libs/system/test/msvc_system/error_code_test/error_code_test.vcproj
branches/bcbboost/libs/system/test/msvc_system/msvc_system.sln
- copied unchanged from r49097, /trunk/libs/system/test/msvc_system/msvc_system.sln
Text files modified:
branches/bcbboost/libs/exception/test/cloning_test.cpp | 4 +-
branches/bcbboost/libs/filesystem/src/operations.cpp | 4 +-
branches/bcbboost/libs/filesystem/test/Jamfile.v2 | 25 ++++++--------------
branches/bcbboost/libs/regex/build/Jamfile.v2 | 34 ++++++++++++++++++++++------
branches/bcbboost/libs/system/src/error_code.cpp | 46 +++++++++++++++++++++++++--------------
branches/bcbboost/libs/system/test/Jamfile.v2 | 1
6 files changed, 67 insertions(+), 47 deletions(-)
Modified: branches/bcbboost/libs/exception/test/cloning_test.cpp
==============================================================================
--- branches/bcbboost/libs/exception/test/cloning_test.cpp (original)
+++ branches/bcbboost/libs/exception/test/cloning_test.cpp 2008-10-01 18:38:45 EDT (Wed, 01 Oct 2008)
@@ -41,8 +41,8 @@
int & count;
explicit
- derives_nothing( int & count ):
- count(count)
+ derives_nothing( int & c ):
+ count(c)
{
++count;
}
Modified: branches/bcbboost/libs/filesystem/src/operations.cpp
==============================================================================
--- branches/bcbboost/libs/filesystem/src/operations.cpp (original)
+++ branches/bcbboost/libs/filesystem/src/operations.cpp 2008-10-01 18:38:45 EDT (Wed, 01 Oct 2008)
@@ -112,9 +112,9 @@
{
const error_code ok;
- const fs::directory_iterator end_itr;
bool is_empty_directory( const std::string & dir_path )
{
+ static const fs::directory_iterator end_itr;
return fs::directory_iterator(fs::path(dir_path)) == end_itr;
}
@@ -133,9 +133,9 @@
inline DWORD get_file_attributes( const wchar_t * ph )
{ return ::GetFileAttributesW( ph ); }
- const fs::wdirectory_iterator wend_itr;
bool is_empty_directory( const std::wstring & dir_path )
{
+ static const fs::wdirectory_iterator wend_itr;
return fs::wdirectory_iterator(fs::wpath(dir_path)) == wend_itr;
}
Modified: branches/bcbboost/libs/filesystem/test/Jamfile.v2
==============================================================================
--- branches/bcbboost/libs/filesystem/test/Jamfile.v2 (original)
+++ branches/bcbboost/libs/filesystem/test/Jamfile.v2 2008-10-01 18:38:45 EDT (Wed, 01 Oct 2008)
@@ -7,42 +7,33 @@
project
: requirements
<library>/boost/filesystem//boost_filesystem
- <define>BOOST_ALL_NO_LIB
<toolset>msvc:<asynch-exceptions>on
;
test-suite "filesystem" :
[ run path_test.cpp
- : : : <define>BOOST_FILESYSTEM_STATIC_LINK
- <link>static
+ : : : <link>static
]
[ run path_test.cpp ../../system/build
- : : : <define>BOOST_FILESYSTEM_DYN_LINK <define>BOOST_SYSTEM_DYN_LINK
- : path_test_dll
+ : : : : path_test_dll
]
[ run operations_test.cpp
- : : : <define>BOOST_FILESYSTEM_STATIC_LINK
- <link>static
+ : : : <link>static
]
[ run operations_test.cpp ../../system/build
- : : : <define>BOOST_FILESYSTEM_DYN_LINK <define>BOOST_SYSTEM_DYN_LINK
- : operations_test_dll
+ : : : : operations_test_dll
]
[ run fstream_test.cpp
- : : : <define>BOOST_FILESYSTEM_STATIC_LINK
- <link>static
+ : : : <link>static
]
[ run convenience_test.cpp
- : : : <define>BOOST_FILESYSTEM_STATIC_LINK
- <link>static
+ : : : <link>static
]
[ run large_file_support_test.cpp
- : : : <define>BOOST_FILESYSTEM_STATIC_LINK
- <link>static
+ : : : <link>static
]
[ run wide_test.cpp
- : : : <define>BOOST_FILESYSTEM_STATIC_LINK
- <link>static
+ : : : <link>static
]
[ compile deprecated_test.cpp ]
Modified: branches/bcbboost/libs/regex/build/Jamfile.v2
==============================================================================
--- branches/bcbboost/libs/regex/build/Jamfile.v2 (original)
+++ branches/bcbboost/libs/regex/build/Jamfile.v2 2008-10-01 18:38:45 EDT (Wed, 01 Oct 2008)
@@ -33,8 +33,6 @@
if [ GLOB $(dir)/include/unicode : utypes.h ]
{
- ECHO Building Boost.Regex with Unicode/ICU support enabled ;
- ECHO Using ICU in $(ICU_PATH:J=" ")/include ;
gHAS_ICU = true ;
# try and find ICU libraries, look for NT versions first:
@@ -153,25 +151,42 @@
if $(gHAS_ICU)
{
+ message icu_config ;
+ message icu_config2
+ : Note: Building Boost.Regex with Unicode/ICU support enabled
+ : " Using ICU in " $(ICU_PATH:J=" ")/include ;
return true ;
}
else
{
- ECHO Building Boost.Regex with the optional Unicode/ICU support disabled. ;
- ECHO Please refer to the Boost.Regex documentation for more information ;
- ECHO (don't panic: this is a strictly optional feature). ;
+ message icu_config
+ : "Building Boost.Regex with the optional Unicode/ICU support disabled."
+ : "Note: Please refer to the Boost.Regex documentation for more information"
+ : "Note: this is a strictly optional feature." ;
+
if $(ICU_PATH)
{
- ECHO Couldn't find utypes.h in $(ICU_PATH:J=" ")/include/unicode ;
+ message icu_config2
+ : WARNING! ICU configuration failed
+ : " Couldn't find utypes.h in " $(ICU_PATH:J=" ")/include/unicode ;
+ }
+ else
+ {
+ message icu_config2 ;
}
}
}
+explicit icu_config ;
+explicit icu_config2 ;
+
if [ check-icu-config ]
{
+if $(gHAS_ICU)
+{
BOOST_REGEX_ICU_OPTS = "<target-os>freebsd:<include>/usr/local/include" ;
BOOST_REGEX_ICU_OPTS += "<define>BOOST_HAS_ICU=1" ;
-
+
if $(ICU_PATH)
{
if $(ICU_PATH) != "/usr" && $(ICU_PATH) != "/usr/local"
@@ -212,6 +227,7 @@
}
#End of addition by Tommy Nordgren
}
+ }
}
SOURCES =
@@ -234,7 +250,7 @@
usinstances.cpp ;
-lib boost_regex : ../src/$(SOURCES) $(ICU_EXTRA_SOURCE)
+lib boost_regex : ../src/$(SOURCES) $(ICU_EXTRA_SOURCE) icu_config2 icu_config
:
#<link>static:<define>BOOST_REGEX_NO_LIB=1
#<link>static:<define>BOOST_REGEX_STATIC_LINK=1
@@ -261,3 +277,5 @@
+
+
Modified: branches/bcbboost/libs/system/src/error_code.cpp
==============================================================================
--- branches/bcbboost/libs/system/src/error_code.cpp (original)
+++ branches/bcbboost/libs/system/src/error_code.cpp 2008-10-01 18:38:45 EDT (Wed, 01 Oct 2008)
@@ -61,11 +61,12 @@
const char * generic_error_category::name() const
{
- return "GENERIC";
+ return "generic";
}
std::string generic_error_category::message( int ev ) const
{
+ static std::string unknown_err( "Unknown error" );
// strerror_r is preferred because it is always thread safe,
// however, we fallback to strerror in certain cases because:
// -- Windows doesn't provide strerror_r.
@@ -81,15 +82,19 @@
|| (defined(__osf__) && !defined(_REENTRANT))\
|| (defined(__vms))
const char * c_str = std::strerror( ev );
- return std::string( c_str ? c_str : "Unknown error" );
- # else
+ return c_str
+ ? std::string( c_str )
+ : unknown_err;
+ # else // use strerror_r
char buf[64];
char * bp = buf;
std::size_t sz = sizeof(buf);
# if defined(__CYGWIN__) || defined(__USE_GNU)
// Oddball version of strerror_r
const char * c_str = strerror_r( ev, bp, sz );
- return std::string( c_str ? c_str : "Unknown error" );
+ return c_str
+ ? std::string( c_str )
+ : unknown_err;
# else
// POSIX version of strerror_r
int result;
@@ -100,7 +105,9 @@
# if defined (__sgi)
const char * c_str = strerror( ev );
result = 0;
- return std::string( c_str ? c_str : "Unknown error" );
+ return c_str
+ ? std::string( c_str )
+ : unknown_err;
# else
result = strerror_r( ev, bp, sz );
# endif
@@ -113,26 +120,31 @@
result = errno;
# endif
if ( result != ERANGE ) break;
- if ( sz > sizeof(buf) ) std::free( bp );
- sz *= 2;
- if ( (bp = static_cast<char*>(std::malloc( sz ))) == 0 )
- return std::string( "ENOMEM" );
+ if ( sz > sizeof(buf) ) std::free( bp );
+ sz *= 2;
+ if ( (bp = static_cast<char*>(std::malloc( sz ))) == 0 )
+ return std::string( "ENOMEM" );
}
}
+ std::string msg();
try
{
- std::string msg( ( result == invalid_argument ) ? "Unknown error" : bp );
- if ( sz > sizeof(buf) ) std::free( bp );
- sz = 0;
- return msg;
+ msg = ( ( result == invalid_argument ) ? "Unknown error" : bp );
}
+
+# ifndef BOOST_NO_EXCEPTIONS
+ // See ticket #2098
catch(...)
{
- if ( sz > sizeof(buf) ) std::free( bp );
- throw;
+ // just eat the exception
}
- # endif
- # endif
+# endif
+
+ if ( sz > sizeof(buf) ) std::free( bp );
+ sz = 0;
+ return msg;
+ # endif // else POSIX version of strerror_r
+ # endif // else use strerror_r
}
// system_error_category implementation --------------------------------//
Modified: branches/bcbboost/libs/system/test/Jamfile.v2
==============================================================================
--- branches/bcbboost/libs/system/test/Jamfile.v2 (original)
+++ branches/bcbboost/libs/system/test/Jamfile.v2 2008-10-01 18:38:45 EDT (Wed, 01 Oct 2008)
@@ -10,7 +10,6 @@
project
: requirements
<library>/boost/system//boost_system
- <define>BOOST_ALL_NO_LIB
<toolset>msvc:<asynch-exceptions>on
;
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk