Index: build/Jamfile.v2
===================================================================
--- build/Jamfile.v2 (revision 73183)
+++ build/Jamfile.v2 (working copy)
@@ -12,6 +12,7 @@
: usage-requirements # pass these requirement to dependents (i.e. users)
shared:BOOST_SYSTEM_DYN_LINK=1
static:BOOST_SYSTEM_STATIC_LINK=1
+ BOOST_USE_WINDOWS_H
;
SOURCES = error_code ;
@@ -20,6 +21,7 @@
: $(SOURCES).cpp
: shared:BOOST_SYSTEM_DYN_LINK=1
static:BOOST_SYSTEM_STATIC_LINK=1
+ BOOST_USE_WINDOWS_H
;
-boost-install boost_system ;
\ No newline at end of file
+boost-install boost_system ;
Index: src/error_code.cpp
===================================================================
--- src/error_code.cpp (revision 74647)
+++ src/error_code.cpp (working copy)
@@ -8,7 +8,11 @@
// See library home page at http://www.boost.org/libs/system
//----------------------------------------------------------------------------//
+#if 1
+#define BOOST_SYSTEM_SOURCE
+#include
+#else
#include
// define BOOST_SYSTEM_SOURCE so that knows
@@ -39,9 +43,6 @@
namespace
{
-#if defined(__PGI)
- using boost::system::errc::invalid_argument;
-#endif
// standard error categories ---------------------------------------------//
class generic_error_category : public error_category
@@ -74,17 +75,16 @@
// 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.
- // -- HP and Sun do provide strerror_r on newer systems, but there is
+ // -- HP and Sundo provide strerror_r on newer systems, but there is
// no way to tell if is available at runtime and in any case their
// versions of strerror are thread safe anyhow.
// -- Linux only sometimes provides strerror_r.
// -- Tru64 provides strerror_r only when compiled -pthread.
// -- VMS doesn't provide strerror_r, but on this platform, strerror is
// thread safe.
- # if defined(BOOST_WINDOWS_API) || defined(__hpux) || defined(__sun)\
+ # if defined(BOOST_SYSTEM_WINDOWS_API) || defined(__hpux) || defined(__sun)\
|| (defined(__linux) && (!defined(__USE_XOPEN2K) || defined(BOOST_SYSTEM_USE_STRERROR)))\
|| (defined(__osf__) && !defined(_REENTRANT))\
- || (defined(__INTEGRITY))\
|| (defined(__vms))\
|| (defined(__QNXNTO__))
const char * c_str = std::strerror( ev );
@@ -428,3 +428,5 @@
} // namespace system
} // namespace boost
+
+#endif
\ No newline at end of file
Index: test/dynamic_link_test.cpp
===================================================================
--- test/dynamic_link_test.cpp (revision 73183)
+++ test/dynamic_link_test.cpp (working copy)
@@ -26,7 +26,7 @@
{
namespace system
{
- BOOST_SYSTEM_DECL void throw_test();
+ BOOST_SYMBOL_EXPORT void throw_test();
}
}
@@ -52,4 +52,4 @@
std::cout << " error: failed to catch boost::system::system_error\n";
return 1;
-}
\ No newline at end of file
+}
Index: test/error_code_test.cpp
===================================================================
--- test/error_code_test.cpp (revision 73183)
+++ test/error_code_test.cpp (working copy)
@@ -30,10 +30,10 @@
// with a boost::system using directive increases use scenario coverage.
using namespace boost::system;
-# if defined( BOOST_WINDOWS_API )
+# if defined( BOOST_SYSTEM_WINDOWS_API )
# include "winerror.h"
# define BOOST_ACCESS_ERROR_MACRO ERROR_ACCESS_DENIED
-# elif defined( BOOST_POSIX_API )
+# elif defined( BOOST_SYSTEM_POSIX_API )
# define BOOST_ACCESS_ERROR_MACRO EACCES
# else
# error "Only supported for POSIX and Windows"
@@ -154,7 +154,7 @@
ec = error_code( -1, system_category() );
std::cout << "error_code message for -1 is \"" << ec.message() << "\"\n";
std::cout << "error_code message for 0 is \"" << ec_0_system.message() << "\"\n";
-#if defined(BOOST_WINDOWS_API)
+#if defined(BOOST_SYSTEM_WINDOWS_API)
// Borland appends newline, so just check text
BOOST_TEST( ec.message().substr(0,13) == "Unknown error" );
BOOST_TEST( ec_0_system.message().substr(0,36) == "The operation completed successfully" );
@@ -177,7 +177,7 @@
error_condition econd_ok;
std::cout << "error_condition message for -1 is \"" << econd.message() << "\"\n";
std::cout << "error_condition message for 0 is \"" << econd_ok.message() << "\"\n";
-#if defined(BOOST_WINDOWS_API)
+#if defined(BOOST_SYSTEM_WINDOWS_API)
// Borland appends newline, so just check text
BOOST_TEST( econd.message().substr(0,13) == "Unknown error" );
BOOST_TEST( econd_ok.message().substr(0,8) == "No error" );
@@ -196,7 +196,7 @@
BOOST_TEST( econd.message() != "" );
BOOST_TEST( econd.message().substr( 0, 13) != "Unknown error" );
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_SYSTEM_WINDOWS_API
std::cout << "Windows tests...\n";
// these tests probe the Windows errc decoder
// test the first entry in the decoder table:
Index: test/error_code_user_test.cpp
===================================================================
--- test/error_code_user_test.cpp (revision 73183)
+++ test/error_code_user_test.cpp (working copy)
@@ -22,7 +22,7 @@
#include
#include
-#ifdef BOOST_POSIX_API
+#ifdef BOOST_SYSTEM_POSIX_API
# include
#else
# include
@@ -37,7 +37,7 @@
boost::system::error_code my_mkdir( const std::string & path )
{
return boost::system::error_code(
-# ifdef BOOST_POSIX_API
+# ifdef BOOST_SYSTEM_POSIX_API
::mkdir( path.c_str(), S_IRWXU|S_IRWXG|S_IROTH|S_IXOTH ) == 0 ? 0 : errno,
# else
::CreateDirectoryA( path.c_str(), 0 ) != 0 ? 0 : ::GetLastError(),
@@ -318,7 +318,7 @@
// check_out_of_memory(user_permission_denied, false);
// check_out_of_memory(user_out_of_memory, true);
//
-//# ifdef BOOST_WINDOWS_API
+//# ifdef BOOST_SYSTEM_WINDOWS_API
// check_success(boost::system::windows::success, true);
// check_success(boost::system::windows::access_denied, false);
// check_success(boost::system::windows::not_enough_memory, false);
Index: test/initialization_test.cpp
===================================================================
--- test/initialization_test.cpp (revision 73183)
+++ test/initialization_test.cpp (working copy)
@@ -18,7 +18,7 @@
foo()
{
boost::system::error_code ec;
- ec == boost::system::posix::permission_denied;
+ ec == boost::system::errc::permission_denied;
}
} f;
Index: test/Jamfile.v2
===================================================================
--- test/Jamfile.v2 (revision 73183)
+++ test/Jamfile.v2 (working copy)
@@ -9,16 +9,19 @@
project
: requirements
- /boost/system//boost_system
+ #/boost/system//boost_system
msvc:on
+ BOOST_SYSTEM_INLINED
+ #BOOST_SYSTEM_NO_DEPRECATED
+ #BOOST_USE_WINDOWS_H
;
-
+
lib throw_test
: throw_test.cpp
: shared:BOOST_SYSTEM_DYN_LINK=1
;
-
+
test-suite "system"
: [ run error_code_test.cpp
: # command line
Index: test/system_error_test.cpp
===================================================================
--- test/system_error_test.cpp (revision 73183)
+++ test/system_error_test.cpp (working copy)
@@ -7,10 +7,12 @@
// See library home page at http://www.boost.org/libs/system
-//----------------------------------------------------------------------------//
+//----------------------------------------------------------------------------//
// test without deprecated features
+#ifndef BOOST_SYSTEM_NO_DEPRECATED
#define BOOST_SYSTEM_NO_DEPRECATED
+#endif
#include
@@ -19,7 +21,7 @@
#include
#include
-#ifdef BOOST_WINDOWS_API
+#ifdef BOOST_SYSTEM_WINDOWS_API
#include
#endif
@@ -38,7 +40,7 @@
std::cout << "test " << desc << "\n what() returns \"" << ex.what() << "\"\n";
BOOST_TEST( ex.code().value() == v );
BOOST_TEST( ex.code().category() == system_category() );
-# ifdef BOOST_WINDOWS_API
+# ifdef BOOST_SYSTEM_WINDOWS_API
LANGID language_id;
# if !defined(__MINGW32__) && !defined(__CYGWIN__)
language_id = ::GetUserDefaultUILanguage();
@@ -63,24 +65,24 @@
{
// all constructors, in the same order as they appear in the header:
- system_error c1_0( error_code(0, system_category()) );
+ system_error c1_0( error_code(0, system_category()) );
system_error c1_1( error_code(1, system_category()) );
system_error c1_2u( error_code(uvalue, system_category()) );
- system_error c2_0( error_code(0, system_category()), string("c2_0") );
+ system_error c2_0( error_code(0, system_category()), string("c2_0") );
system_error c2_1( error_code(1, system_category()), string("c2_1") );
- system_error c3_0( error_code(0, system_category()), "c3_0" );
+ system_error c3_0( error_code(0, system_category()), "c3_0" );
system_error c3_1( error_code(1, system_category()), "c3_1" );
- system_error c4_0( 0, system_category() );
+ system_error c4_0( 0, system_category() );
system_error c4_1( 1, system_category() );
system_error c4_2u( uvalue, system_category() );
- system_error c5_0( 0, system_category(), string("c5_0") );
+ system_error c5_0( 0, system_category(), string("c5_0") );
system_error c5_1( 1, system_category(), string("c5_1") );
- system_error c6_0( 0, system_category(), "c6_0" );
+ system_error c6_0( 0, system_category(), "c6_0" );
system_error c6_1( 1, system_category(), "c6_1" );
TEST( c1_0, 0, "The operation completed successfully" );
Index: test/throw_test.cpp
===================================================================
--- test/throw_test.cpp (revision 73183)
+++ test/throw_test.cpp (working copy)
@@ -15,15 +15,13 @@
// define BOOST_SYSTEM_SOURCE so that knows
// the library is being built (possibly exporting rather than importing code)
-#define BOOST_SYSTEM_SOURCE
#include
-
namespace boost
{
namespace system
{
- BOOST_SYSTEM_DECL void throw_test()
+ BOOST_SYMBOL_EXPORT void throw_test()
{
throw system_error(9999, system_category(), "boo boo");
}