Major upgrade to Boost.Config symbol visibility macros for shared libraries, based on patches from Jürgen Hunold with mods by Beman Dawes. Upgrade Boost.System to use the new visibility macros. Fixes #3697 and provides foundation for fixing 2114, 2309, etc.

[SVN r62140]
This commit is contained in:
Beman Dawes
2010-05-22 12:12:00 +00:00
parent ae67c86d2b
commit 2bb0075e3f
13 changed files with 193 additions and 70 deletions

View File

@@ -1,4 +1,4 @@
// boost/system/config.hpp -------------------------------------------------// // boost/system/config.hpp -----------------------------------------------------------//
// Copyright Beman Dawes 2003, 2006 // Copyright Beman Dawes 2003, 2006
@@ -18,40 +18,29 @@
# if defined( BOOST_WINDOWS_API ) && defined( BOOST_POSIX_API ) # if defined( BOOST_WINDOWS_API ) && defined( BOOST_POSIX_API )
# error both BOOST_WINDOWS_API and BOOST_POSIX_API are defined # error both BOOST_WINDOWS_API and BOOST_POSIX_API are defined
# elif !defined( BOOST_WINDOWS_API ) && !defined( BOOST_POSIX_API ) # elif !defined( BOOST_WINDOWS_API ) && !defined( BOOST_POSIX_API )
# if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__CYGWIN__) # if defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
// All Win32 development environments, including 64-bit Windows and MinGW, define
// _WIN32 or one of its variant spellings. Note that Cygwin is a POSIX environment,
// so does not define _WIN32 or its variants.
# define BOOST_WINDOWS_API # define BOOST_WINDOWS_API
# else # else
# define BOOST_POSIX_API # define BOOST_POSIX_API
# endif # endif
# endif # endif
// enable dynamic linking on Windows ---------------------------------------// // enable dynamic or static linking as requested --------------------------------------//
//# if (defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SYSTEM_DYN_LINK)) && defined(__BORLANDC__) && defined(__WIN32__)
//# error Dynamic linking Boost.System does not work for Borland; use static linking instead
//# endif
#ifdef BOOST_HAS_DECLSPEC // defined in config system
// we need to import/export our code only if the user has specifically
// asked for it by defining either BOOST_ALL_DYN_LINK if they want all boost
// libraries to be dynamically linked, or BOOST_SYSTEM_DYN_LINK
// if they want just this one to be dynamically liked:
#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SYSTEM_DYN_LINK) #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SYSTEM_DYN_LINK)
// export if this is our own source, otherwise import: # if defined(BOOST_SYSTEM_SOURCE)
#ifdef BOOST_SYSTEM_SOURCE # define BOOST_SYSTEM_DECL BOOST_SYMBOL_EXPORT
# define BOOST_SYSTEM_DECL __declspec(dllexport) # else
# define BOOST_SYSTEM_DECL BOOST_SYMBOL_IMPORT
# endif
#else #else
# define BOOST_SYSTEM_DECL __declspec(dllimport) # define BOOST_SYSTEM_DECL
#endif // BOOST_SYSTEM_SOURCE
#endif // DYN_LINK
#endif // BOOST_HAS_DECLSPEC
//
// if BOOST_SYSTEM_DECL isn't defined yet define it now:
#ifndef BOOST_SYSTEM_DECL
#define BOOST_SYSTEM_DECL
#endif #endif
// enable automatic library variant selection ------------------------------// // enable automatic library variant selection ----------------------------------------//
#if !defined(BOOST_SYSTEM_SOURCE) && !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_SYSTEM_NO_LIB) #if !defined(BOOST_SYSTEM_SOURCE) && !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_SYSTEM_NO_LIB)
// //

View File

@@ -17,9 +17,11 @@ namespace boost
{ {
namespace system namespace system
{ {
// class system_error --------------------------------------------------// // class system_error ------------------------------------------------------------//
class system_error : public std::runtime_error class BOOST_SYMBOL_VISIBLE system_error : public std::runtime_error
// BOOST_SYMBOL_VISIBLE is needed by GCC to ensure system_error thrown from a shared
// library can be caught. See svn.boost.org/trac/boost/ticket/3697
{ {
public: public:
system_error( error_code ec ) system_error( error_code ec )

View File

@@ -12,6 +12,12 @@ project
<library>/boost/system//boost_system <library>/boost/system//boost_system
<toolset>msvc:<asynch-exceptions>on <toolset>msvc:<asynch-exceptions>on
; ;
lib throw_test
: throw_test.cpp
: <link>shared:<define>BOOST_SYSTEM_DYN_LINK=1
;
test-suite "system" test-suite "system"
: [ run error_code_test.cpp : [ run error_code_test.cpp
@@ -21,21 +27,25 @@ project
<link>static <link>static
] ]
[ run error_code_test.cpp [ run error_code_test.cpp
: : : : error_code_test_dll : : : <link>shared : error_code_test_shared
] ]
[ run error_code_user_test.cpp [ run error_code_user_test.cpp
: : : <link>static : : : <link>static
] ]
[ run error_code_user_test.cpp [ run error_code_user_test.cpp
: : : : error_code_user_test_dll : : : <link>shared : error_code_user_test_shared
] ]
[ run system_error_test.cpp [ run system_error_test.cpp
: : : <link>static : : : <link>static
] ]
[ run system_error_test.cpp [ run system_error_test.cpp
: : : : system_error_test_dll : : : <link>shared : system_error_test_shared
]
[ run dynamic_link_test.cpp throw_test
: : : <link>shared : throw_test_shared
] ]
[ run initialization_test.cpp [ run initialization_test.cpp
: : : <link>shared : initialization_test_shared
] ]
[ run header_only_test.cpp [ run header_only_test.cpp
: : : <link>static : : : <link>static

View File

@@ -0,0 +1,55 @@
// dynamic_link_test.cpp -------------------------------------------------------------//
// Copyright Beman Dawes 2010
// Distributed under the Boost Software License, Version 1.0.
// See www.boost.org/LICENSE_1_0.txt
// Library home page is www.boost.org/libs/system
//--------------------------------------------------------------------------------------//
// Dynamic link libraries (DLL's), also know as dynamic shared objects (DSO's),
// can cause symbol visability problems unless carefully configured. One of the
// manifestations, particularly with GCC, is that a system_error exception thrown from
// a DLL or DSO is not caught.
//
// The purpose of this program is to test for that error.
//--------------------------------------------------------------------------------------//
#include <boost/system/system_error.hpp>
#include <iostream>
namespace boost
{
namespace system
{
BOOST_SYSTEM_DECL void throw_test();
}
}
int main()
{
try
{
boost::system::throw_test();
}
catch (const boost::system::system_error& ex)
{
std::cout << " caught boost::system::system_error as expected\n";
std::cout << " what() reports " << ex.what() << '\n';
return 0;
}
catch (const std::runtime_error& ex)
{
std::cout << " error: caught std::runtime_error instead of boost::system::system_error\n";
std::cout << " what() reports " << ex.what() << '\n';
return 1;
}
std::cout << " error: failed to catch boost::system::system_error\n";
return 1;
}

View File

@@ -59,6 +59,12 @@ namespace
int main( int, char ** ) int main( int, char ** )
{ {
std::cout << "Conversion use cases...\n";
error_condition x1( errc::file_exists );
//error_code x2( errc::file_exists ); // should fail to compile
make_error_code(errc::file_exists);
make_error_condition(errc::file_exists);
std::cout << "General tests...\n"; std::cout << "General tests...\n";
// unit tests: // unit tests:

View File

@@ -18,7 +18,7 @@
#include <boost/cerrno.hpp> #include <boost/cerrno.hpp>
#include <string> #include <string>
#include <cstdio> #include <cstdio>
#include <boost/test/minimal.hpp> #include <boost/detail/lightweight_test.hpp>
#ifdef BOOST_POSIX_API #ifdef BOOST_POSIX_API
# include <sys/stat.h> # include <sys/stat.h>
@@ -264,7 +264,7 @@ namespace lib4
// //
// void check_success(const boost::system::error_code& ec, bool expect) // void check_success(const boost::system::error_code& ec, bool expect)
// { // {
// BOOST_CHECK( (ec == boost::system::posix::success) == expect ); // BOOST_TEST( (ec == boost::system::posix::success) == expect );
// if (ec == boost::system::posix::success) // if (ec == boost::system::posix::success)
// std::cout << "yes... " << (expect ? "ok" : "fail") << '\n'; // std::cout << "yes... " << (expect ? "ok" : "fail") << '\n';
// else // else
@@ -273,7 +273,7 @@ namespace lib4
// //
// void check_permission_denied(const boost::system::error_code& ec, bool expect) // void check_permission_denied(const boost::system::error_code& ec, bool expect)
// { // {
// BOOST_CHECK( (ec == boost::system::posix::permission_denied) == expect ); // BOOST_TEST( (ec == boost::system::posix::permission_denied) == expect );
// if (ec == boost::system::posix::permission_denied) // if (ec == boost::system::posix::permission_denied)
// std::cout << "yes... " << (expect ? "ok" : "fail") << '\n'; // std::cout << "yes... " << (expect ? "ok" : "fail") << '\n';
// else // else
@@ -282,7 +282,7 @@ namespace lib4
// //
// void check_out_of_memory(const boost::system::error_code& ec, bool expect) // void check_out_of_memory(const boost::system::error_code& ec, bool expect)
// { // {
// BOOST_CHECK( (ec == boost::system::posix::not_enough_memory) == expect ); // BOOST_TEST( (ec == boost::system::posix::not_enough_memory) == expect );
// if (ec == boost::system::posix::not_enough_memory) // if (ec == boost::system::posix::not_enough_memory)
// std::cout << "yes... " << (expect ? "ok" : "fail") << '\n'; // std::cout << "yes... " << (expect ? "ok" : "fail") << '\n';
// else // else
@@ -337,7 +337,7 @@ namespace lib4
// ------------------------------------------------------------------------ // // ------------------------------------------------------------------------ //
int test_main( int, char *[] ) int main( int, char *[] )
{ {
boost::system::error_code ec; boost::system::error_code ec;
@@ -346,35 +346,35 @@ int test_main( int, char *[] )
ec = my_mkdir( "/no-such-file-or-directory/will-not-succeed" ); ec = my_mkdir( "/no-such-file-or-directory/will-not-succeed" );
std::cout << "ec.value() is " << ec.value() << '\n'; std::cout << "ec.value() is " << ec.value() << '\n';
BOOST_CHECK( ec ); BOOST_TEST( ec );
BOOST_CHECK( ec == boost::system::posix::no_such_file_or_directory ); BOOST_TEST( ec == boost::system::posix::no_such_file_or_directory );
BOOST_CHECK( ec.category() == boost::system::system_category ); BOOST_TEST( ec.category() == boost::system::system_category );
// Library 2 tests: // Library 2 tests:
ec = my_remove( "/no-such-file-or-directory" ); ec = my_remove( "/no-such-file-or-directory" );
std::cout << "ec.value() is " << ec.value() << '\n'; std::cout << "ec.value() is " << ec.value() << '\n';
BOOST_CHECK( ec ); BOOST_TEST( ec );
BOOST_CHECK( ec == boost::system::posix::no_such_file_or_directory ); BOOST_TEST( ec == boost::system::posix::no_such_file_or_directory );
BOOST_CHECK( ec.category() == boost::system::posix_category ); BOOST_TEST( ec.category() == boost::system::posix_category );
// Library 3 tests: // Library 3 tests:
ec = boost::lib3::boo_boo; ec = boost::lib3::boo_boo;
std::cout << "ec.value() is " << ec.value() << '\n'; std::cout << "ec.value() is " << ec.value() << '\n';
BOOST_CHECK( ec ); BOOST_TEST( ec );
BOOST_CHECK( ec == boost::lib3::boo_boo ); BOOST_TEST( ec == boost::lib3::boo_boo );
BOOST_CHECK( ec.value() == boost::lib3::boo_boo ); BOOST_TEST( ec.value() == boost::lib3::boo_boo );
BOOST_CHECK( ec.category() == boost::lib3::lib3_error_category ); BOOST_TEST( ec.category() == boost::lib3::lib3_error_category );
BOOST_CHECK( ec == boost::system::posix::io_error ); BOOST_TEST( ec == boost::system::posix::io_error );
boost::system::error_code ec3( boost::lib3::boo_boo+100, boost::system::error_code ec3( boost::lib3::boo_boo+100,
boost::lib3::lib3_error_category ); boost::lib3::lib3_error_category );
BOOST_CHECK( ec3.category() == boost::lib3::lib3_error_category ); BOOST_TEST( ec3.category() == boost::lib3::lib3_error_category );
BOOST_CHECK( ec3.default_error_condition().category() BOOST_TEST( ec3.default_error_condition().category()
== boost::lib3::lib3_error_category ); == boost::lib3::lib3_error_category );
// Library 4 tests: // Library 4 tests:
@@ -382,16 +382,16 @@ int test_main( int, char *[] )
ec = lib4::boo_boo; ec = lib4::boo_boo;
std::cout << "ec.value() is " << ec.value() << '\n'; std::cout << "ec.value() is " << ec.value() << '\n';
BOOST_CHECK( ec ); BOOST_TEST( ec );
BOOST_CHECK( ec == lib4::boo_boo ); BOOST_TEST( ec == lib4::boo_boo );
BOOST_CHECK( ec.value() == lib4::boo_boo.value() ); BOOST_TEST( ec.value() == lib4::boo_boo.value() );
BOOST_CHECK( ec.category() == lib4::lib4_error_category ); BOOST_TEST( ec.category() == lib4::lib4_error_category );
BOOST_CHECK( ec == boost::system::posix::io_error ); BOOST_TEST( ec == boost::system::posix::io_error );
boost::system::error_code ec4( lib4::boo_boo.value()+100, boost::system::error_code ec4( lib4::boo_boo.value()+100,
lib4::lib4_error_category ); lib4::lib4_error_category );
BOOST_CHECK( ec4.default_error_condition().category() BOOST_TEST( ec4.default_error_condition().category()
== lib4::lib4_error_category ); == lib4::lib4_error_category );
// Test 3 // Test 3

View File

@@ -13,11 +13,10 @@
#define BOOST_ERROR_CODE_HEADER_ONLY #define BOOST_ERROR_CODE_HEADER_ONLY
#include <boost/test/minimal.hpp> #include <boost/detail/lightweight_test.hpp>
#include <boost/system/error_code.hpp> #include <boost/system/error_code.hpp>
int test_main( int, char*[] ) int main( int, char*[] )
{ {
boost::system::error_code ec( 0, boost::system::system_category ); boost::system::error_code ec( 0, boost::system::system_category );
return 0; return 0;

View File

@@ -10,7 +10,7 @@
// This test verifiies that the error_category vtable does not suffer from // This test verifiies that the error_category vtable does not suffer from
// order-of-initialization problems. // order-of-initialization problems.
#include <boost/test/minimal.hpp> #include <boost/detail/lightweight_test.hpp>
#include <boost/system/error_code.hpp> #include <boost/system/error_code.hpp>
struct foo struct foo
@@ -22,7 +22,7 @@ struct foo
} }
} f; } f;
int test_main( int, char ** ) int main( int, char ** )
{ {
return 0; return 0;
} }

View File

@@ -14,7 +14,7 @@
#include <boost/config/warning_disable.hpp> #include <boost/config/warning_disable.hpp>
#include <boost/test/minimal.hpp> #include <boost/detail/lightweight_test.hpp>
#include <boost/system/system_error.hpp> #include <boost/system/system_error.hpp>
#include <iostream> #include <iostream>
#include <string> #include <string>
@@ -36,8 +36,8 @@ namespace
int v, const char * str ) int v, const char * str )
{ {
std::cout << "test " << desc << "\n what() returns \"" << ex.what() << "\"\n"; std::cout << "test " << desc << "\n what() returns \"" << ex.what() << "\"\n";
BOOST_CHECK( ex.code().value() == v ); BOOST_TEST( ex.code().value() == v );
BOOST_CHECK( ex.code().category() == system_category ); BOOST_TEST( ex.code().category() == system_category );
# ifdef BOOST_WINDOWS_API # ifdef BOOST_WINDOWS_API
LANGID language_id; LANGID language_id;
# if !defined(__MINGW32__) && !defined(__CYGWIN__) # if !defined(__MINGW32__) && !defined(__CYGWIN__)
@@ -48,7 +48,7 @@ namespace
// std::cout << "GetUserDefaultUILanguage() returns " << language_id << '\n'; // std::cout << "GetUserDefaultUILanguage() returns " << language_id << '\n';
if ( language_id == 0x0409 ) // English (United States) if ( language_id == 0x0409 ) // English (United States)
{ {
BOOST_CHECK( std::string( ex.what() ) == str ); BOOST_TEST( std::string( ex.what() ) == str );
if ( std::string( ex.what() ) != str ) if ( std::string( ex.what() ) != str )
std::cout << "expected \"" << str << "\", but what() returned \"" std::cout << "expected \"" << str << "\", but what() returned \""
<< ex.what() << "\"\n"; << ex.what() << "\"\n";
@@ -59,7 +59,7 @@ namespace
const boost::uint_least32_t uvalue = 2u; const boost::uint_least32_t uvalue = 2u;
} }
int test_main( int, char *[] ) int main( int, char *[] )
{ {
// all constructors, in the same order as they appear in the header: // all constructors, in the same order as they appear in the header:

View File

@@ -7,13 +7,13 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../../../../.." AdditionalIncludeDirectories="../../../../.."
PreprocessorDefinitions="BOOST_ALL_NO_LIB" PreprocessorDefinitions="BOOST_ALL_NO_LIB;BOOST_ALL_DYN_LINK"
ExceptionHandling="2" ExceptionHandling="2"
WarningLevel="4" WarningLevel="4"
/> />
<Tool <Tool
Name="VCPostBuildEventTool" Name="VCPostBuildEventTool"
Description="Executing test $(TargetName).exe..." Description=""
CommandLine="&quot;$(TargetDir)\$(TargetName).exe&quot; --result_code=no --report_level=no" CommandLine=""
/> />
</VisualStudioPropertySheet> </VisualStudioPropertySheet>

View File

@@ -86,6 +86,8 @@
/> />
<Tool <Tool
Name="VCPostBuildEventTool" Name="VCPostBuildEventTool"
Description="Executing test $(TargetName).exe..."
CommandLine="&quot;$(TargetDir)\$(TargetName).exe&quot; --result_code=no --report_level=no"
/> />
</Configuration> </Configuration>
<Configuration <Configuration
@@ -161,6 +163,8 @@
/> />
<Tool <Tool
Name="VCPostBuildEventTool" Name="VCPostBuildEventTool"
Description="Executing test $(TargetName).exe..."
CommandLine="&quot;$(TargetDir)\$(TargetName).exe&quot; --result_code=no --report_level=no"
/> />
</Configuration> </Configuration>
</Configurations> </Configurations>
@@ -172,10 +176,6 @@
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
> >
<File
RelativePath="..\..\..\src\error_code.cpp"
>
</File>
<File <File
RelativePath="..\..\error_code_test.cpp" RelativePath="..\..\error_code_test.cpp"
> >

View File

@@ -2,8 +2,27 @@
Microsoft Visual Studio Solution File, Format Version 10.00 Microsoft Visual Studio Solution File, Format Version 10.00
# Visual C++ Express 2008 # Visual C++ Express 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "error_code_test", "error_code_test\error_code_test.vcproj", "{81960557-E9A9-4E81-AC96-9E11C33CB058}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "error_code_test", "error_code_test\error_code_test.vcproj", "{81960557-E9A9-4E81-AC96-9E11C33CB058}"
ProjectSection(ProjectDependencies) = postProject
{22892211-A1F3-435B-8B97-A12E8772599E} = {22892211-A1F3-435B-8B97-A12E8772599E}
EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "system_error_test", "system_error_test\system_error_test.vcproj", "{CBD12E59-99E5-4F35-9B66-0554D0FBDB76}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "system_error_test", "system_error_test\system_error_test.vcproj", "{CBD12E59-99E5-4F35-9B66-0554D0FBDB76}"
ProjectSection(ProjectDependencies) = postProject
{22892211-A1F3-435B-8B97-A12E8772599E} = {22892211-A1F3-435B-8B97-A12E8772599E}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dynamic_link_test", "dynamic_link_test\dynamic_link_test.vcproj", "{AD186B11-9132-48A9-9F24-3522C2310B0D}"
ProjectSection(ProjectDependencies) = postProject
{F6D9B408-84A3-405A-93ED-DE5AA8CF84D7} = {F6D9B408-84A3-405A-93ED-DE5AA8CF84D7}
{22892211-A1F3-435B-8B97-A12E8772599E} = {22892211-A1F3-435B-8B97-A12E8772599E}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "system_dll", "system_dll\system_dll.vcproj", "{22892211-A1F3-435B-8B97-A12E8772599E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "throw_test_dll", "throw_test_dll\throw_test_dll.vcproj", "{F6D9B408-84A3-405A-93ED-DE5AA8CF84D7}"
ProjectSection(ProjectDependencies) = postProject
{22892211-A1F3-435B-8B97-A12E8772599E} = {22892211-A1F3-435B-8B97-A12E8772599E}
EndProjectSection
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -19,6 +38,18 @@ Global
{CBD12E59-99E5-4F35-9B66-0554D0FBDB76}.Debug|Win32.Build.0 = Debug|Win32 {CBD12E59-99E5-4F35-9B66-0554D0FBDB76}.Debug|Win32.Build.0 = Debug|Win32
{CBD12E59-99E5-4F35-9B66-0554D0FBDB76}.Release|Win32.ActiveCfg = Release|Win32 {CBD12E59-99E5-4F35-9B66-0554D0FBDB76}.Release|Win32.ActiveCfg = Release|Win32
{CBD12E59-99E5-4F35-9B66-0554D0FBDB76}.Release|Win32.Build.0 = Release|Win32 {CBD12E59-99E5-4F35-9B66-0554D0FBDB76}.Release|Win32.Build.0 = Release|Win32
{AD186B11-9132-48A9-9F24-3522C2310B0D}.Debug|Win32.ActiveCfg = Debug|Win32
{AD186B11-9132-48A9-9F24-3522C2310B0D}.Debug|Win32.Build.0 = Debug|Win32
{AD186B11-9132-48A9-9F24-3522C2310B0D}.Release|Win32.ActiveCfg = Release|Win32
{AD186B11-9132-48A9-9F24-3522C2310B0D}.Release|Win32.Build.0 = Release|Win32
{22892211-A1F3-435B-8B97-A12E8772599E}.Debug|Win32.ActiveCfg = Debug|Win32
{22892211-A1F3-435B-8B97-A12E8772599E}.Debug|Win32.Build.0 = Debug|Win32
{22892211-A1F3-435B-8B97-A12E8772599E}.Release|Win32.ActiveCfg = Release|Win32
{22892211-A1F3-435B-8B97-A12E8772599E}.Release|Win32.Build.0 = Release|Win32
{F6D9B408-84A3-405A-93ED-DE5AA8CF84D7}.Debug|Win32.ActiveCfg = Debug|Win32
{F6D9B408-84A3-405A-93ED-DE5AA8CF84D7}.Debug|Win32.Build.0 = Debug|Win32
{F6D9B408-84A3-405A-93ED-DE5AA8CF84D7}.Release|Win32.ActiveCfg = Release|Win32
{F6D9B408-84A3-405A-93ED-DE5AA8CF84D7}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

31
test/throw_test.cpp Normal file
View File

@@ -0,0 +1,31 @@
// throw_test.cpp --------------------------------------------------------===========-//
// Copyright Beman Dawes 2010
// Distributed under the Boost Software License, Version 1.0.
// See www.boost.org/LICENSE_1_0.txt
// Library home page is www.boost.org/libs/system
//--------------------------------------------------------------------------------------//
// See dynamic_link_test.cpp comments for use case.
//--------------------------------------------------------------------------------------//
// define BOOST_SYSTEM_SOURCE so that <boost/system/config.hpp> knows
// the library is being built (possibly exporting rather than importing code)
#define BOOST_SYSTEM_SOURCE
#include <boost/system/system_error.hpp>
namespace boost
{
namespace system
{
BOOST_SYSTEM_DECL void throw_test()
{
throw system_error(9999, get_system_category(), "boo boo");
}
}
}