forked from boostorg/system
Turns out the --dep_name errors were due to functions in the wrong namespace (Chris Kohlhoff)
[SVN r39553]
This commit is contained in:
@@ -172,10 +172,6 @@ namespace boost
|
|||||||
static const error_category & errno_ecat = get_posix_category();
|
static const error_category & errno_ecat = get_posix_category();
|
||||||
static const error_category & native_ecat = get_system_category();
|
static const error_category & native_ecat = get_system_category();
|
||||||
|
|
||||||
// EDG with --dep_name requires make_error_condition be defined before use
|
|
||||||
|
|
||||||
template <class T> error_condition make_error_condition(T);
|
|
||||||
|
|
||||||
// class error_condition -----------------------------------------------//
|
// class error_condition -----------------------------------------------//
|
||||||
|
|
||||||
// error_conditions are portable, error_codes are system or lib specific
|
// error_conditions are portable, error_codes are system or lib specific
|
||||||
@@ -259,10 +255,6 @@ namespace boost
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// EDG with --dep_name requires make_error_code be defined before use
|
|
||||||
|
|
||||||
template <class T> error_code make_error_code(T);
|
|
||||||
|
|
||||||
// class error_code ----------------------------------------------------//
|
// class error_code ----------------------------------------------------//
|
||||||
|
|
||||||
// We want error_code to be a value type that can be copied without slicing
|
// We want error_code to be a value type that can be copied without slicing
|
||||||
@@ -408,13 +400,16 @@ namespace boost
|
|||||||
|
|
||||||
// make_* functions for posix::posix_errno -----------------------------//
|
// make_* functions for posix::posix_errno -----------------------------//
|
||||||
|
|
||||||
// explicit conversion:
|
namespace posix
|
||||||
template<> inline error_code make_error_code( posix::posix_errno e )
|
{
|
||||||
{ return error_code( e, posix_category ); }
|
// explicit conversion:
|
||||||
|
inline error_code make_error_code( posix_errno e )
|
||||||
|
{ return error_code( e, posix_category ); }
|
||||||
|
|
||||||
// implicit conversion:
|
// implicit conversion:
|
||||||
template<> inline error_condition make_error_condition( posix::posix_errno e )
|
inline error_condition make_error_condition( posix_errno e )
|
||||||
{ return error_condition( e, posix_category ); }
|
{ return error_condition( e, posix_category ); }
|
||||||
|
}
|
||||||
|
|
||||||
// error_category default implementation -------------------------------//
|
// error_category default implementation -------------------------------//
|
||||||
|
|
||||||
@@ -496,8 +491,11 @@ namespace boost
|
|||||||
template<> struct is_error_code_enum<cygwin::cygwin_errno>
|
template<> struct is_error_code_enum<cygwin::cygwin_errno>
|
||||||
{ static const bool value = true; };
|
{ static const bool value = true; };
|
||||||
|
|
||||||
template<> inline error_code make_error_code(cygwin::cygwin_errno e)
|
namespace cygwin
|
||||||
{ return error_code( e, system_category ); }
|
{
|
||||||
|
inline error_code make_error_code( cygwin_errno e )
|
||||||
|
{ return error_code( e, system_category ); }
|
||||||
|
}
|
||||||
|
|
||||||
# elif defined(linux) || defined(__linux) || defined(__linux__)
|
# elif defined(linux) || defined(__linux) || defined(__linux__)
|
||||||
|
|
||||||
@@ -563,8 +561,11 @@ namespace boost
|
|||||||
template<> struct is_error_code_enum<Linux::linux_error>
|
template<> struct is_error_code_enum<Linux::linux_error>
|
||||||
{ static const bool value = true; };
|
{ static const bool value = true; };
|
||||||
|
|
||||||
template<> inline error_code make_error_code(Linux::linux_error e)
|
namespace Linux
|
||||||
{ return error_code( e, system_category ); }
|
{
|
||||||
|
inline error_code make_error_code( linux_error e )
|
||||||
|
{ return error_code( e, system_category ); }
|
||||||
|
}
|
||||||
|
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
@@ -642,13 +643,17 @@ namespace boost
|
|||||||
|
|
||||||
// TODO: add more Windows errors
|
// TODO: add more Windows errors
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace windows
|
} // namespace windows
|
||||||
|
|
||||||
template<> struct is_error_code_enum<windows::windows_error>
|
template<> struct is_error_code_enum<windows::windows_error>
|
||||||
{ static const bool value = true; };
|
{ static const bool value = true; };
|
||||||
|
|
||||||
template<> inline error_code make_error_code(windows::windows_error e)
|
namespace windows
|
||||||
{ return error_code( e, system_category ); }
|
{
|
||||||
|
inline error_code make_error_code( windows_error e )
|
||||||
|
{ return error_code( e, system_category ); }
|
||||||
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
# error BOOST_POSIX_API or BOOST_WINDOWS_API must be defined
|
# error BOOST_POSIX_API or BOOST_WINDOWS_API must be defined
|
||||||
|
@@ -73,23 +73,26 @@ namespace boost
|
|||||||
namespace lib3
|
namespace lib3
|
||||||
{
|
{
|
||||||
// lib3 has its own error_category:
|
// lib3 has its own error_category:
|
||||||
extern const boost::system::error_category & lib3_error_category;
|
const boost::system::error_category & get_lib3_error_category();
|
||||||
|
const boost::system::error_category & lib3_error_category = get_lib3_error_category();
|
||||||
|
|
||||||
enum error
|
enum error
|
||||||
{
|
{
|
||||||
boo_boo=123,
|
boo_boo=123,
|
||||||
big_boo_boo
|
big_boo_boo
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace system
|
namespace system
|
||||||
{
|
{
|
||||||
template<> struct is_error_code_enum<boost::lib3::error>
|
template<> struct is_error_code_enum<boost::lib3::error>
|
||||||
{ static const bool value = true; };
|
{ static const bool value = true; };
|
||||||
|
}
|
||||||
|
|
||||||
template<> inline error_code make_error_code(boost::lib3::error e)
|
namespace lib3
|
||||||
{ return error_code(e,boost::lib3::lib3_error_category); }
|
{
|
||||||
|
inline boost::system::error_code make_error_code(error e)
|
||||||
|
{ return boost::system::error_code(e,lib3_error_category); }
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -125,12 +128,14 @@ namespace boost
|
|||||||
if ( ev == big_boo_boo ) return std::string("big boo boo");
|
if ( ev == big_boo_boo ) return std::string("big boo boo");
|
||||||
return std::string("unknown error");
|
return std::string("unknown error");
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const lib3_error_category_imp lib3_error_category_const;
|
const boost::system::error_category & get_lib3_error_category()
|
||||||
|
{
|
||||||
const boost::system::error_category & lib3_error_category
|
static const lib3_error_category_imp l3ecat;
|
||||||
= lib3_error_category_const;
|
return l3ecat;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -147,7 +152,8 @@ namespace boost
|
|||||||
namespace lib4
|
namespace lib4
|
||||||
{
|
{
|
||||||
// lib4 has its own error_category:
|
// lib4 has its own error_category:
|
||||||
extern const boost::system::error_category & lib4_error_category;
|
const boost::system::error_category & get_lib4_error_category();
|
||||||
|
const boost::system::error_category & lib4_error_category = get_lib4_error_category();
|
||||||
|
|
||||||
extern const boost::system::error_code boo_boo;
|
extern const boost::system::error_code boo_boo;
|
||||||
extern const boost::system::error_code big_boo_boo;
|
extern const boost::system::error_code big_boo_boo;
|
||||||
@@ -183,10 +189,11 @@ namespace lib4
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const lib4_error_category_imp lib4_error_category_const;
|
const boost::system::error_category & get_lib4_error_category()
|
||||||
|
{
|
||||||
const boost::system::error_category & lib4_error_category
|
static const lib4_error_category_imp l4ecat;
|
||||||
= lib4_error_category_const;
|
return l4ecat;
|
||||||
|
}
|
||||||
|
|
||||||
const boost::system::error_code boo_boo( 456, lib4_error_category );
|
const boost::system::error_code boo_boo( 456, lib4_error_category );
|
||||||
const boost::system::error_code big_boo_boo( 789, lib4_error_category );
|
const boost::system::error_code big_boo_boo( 789, lib4_error_category );
|
||||||
|
Reference in New Issue
Block a user