Add support for g++ 4.7 when compiling in C++11 mode.

This commit is contained in:
Christopher Kohlhoff 2012-05-29 07:23:55 +10:00
parent 0a33dcbd6f
commit 2ded50396f
6 changed files with 28 additions and 6 deletions

View File

@ -121,6 +121,10 @@ sub copy_source_file
{ {
$line =~ s/asio_detail_posix_thread_function/boost_asio_detail_posix_thread_function/g; $line =~ s/asio_detail_posix_thread_function/boost_asio_detail_posix_thread_function/g;
} }
if ($line =~ /const ASIO_ERROR_CATEGORY_NOEXCEPT$/)
{
$line =~ s/ ASIO_ERROR_CATEGORY_NOEXCEPT$//;
}
if ($line =~ /ASIO_/ && !($line =~ /BOOST_ASIO_/)) if ($line =~ /ASIO_/ && !($line =~ /BOOST_ASIO_/))
{ {
$line =~ s/ASIO_/BOOST_ASIO_/g; $line =~ s/ASIO_/BOOST_ASIO_/g;

View File

@ -112,6 +112,20 @@
# endif // defined(__GNUC__) # endif // defined(__GNUC__)
#endif // !defined(ASIO_DISABLE_STD_SYSTEM_ERROR) #endif // !defined(ASIO_DISABLE_STD_SYSTEM_ERROR)
// Compliant C++11 compilers put noexcept specifiers on error_category members.
#if !defined(ASIO_ERROR_CATEGORY_NOEXCEPT)
# if defined(__GNUC__)
# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
# if defined(__GXX_EXPERIMENTAL_CXX0X__)
# define ASIO_ERROR_CATEGORY_NOEXCEPT noexcept(true)
# endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) || (__GNUC__ > 4)
# endif // defined(__GNUC__)
# if !defined(ASIO_ERROR_CATEGORY_NOEXCEPT)
# define ASIO_ERROR_CATEGORY_NOEXCEPT
# endif // !defined(ASIO_ERROR_CATEGORY_NOEXCEPT)
#endif // !defined(ASIO_ERROR_CATEGORY_NOEXCEPT)
// Standard library support for arrays. // Standard library support for arrays.
#if !defined(ASIO_DISABLE_STD_ARRAY) #if !defined(ASIO_DISABLE_STD_ARRAY)
# if defined(__GNUC__) # if defined(__GNUC__)
@ -163,7 +177,9 @@
# if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) # if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
# if defined(__GXX_EXPERIMENTAL_CXX0X__) # if defined(__GXX_EXPERIMENTAL_CXX0X__)
# define ASIO_HAS_STD_CHRONO # define ASIO_HAS_STD_CHRONO
# if ((__GNUC__ == 4) && (__GNUC_MINOR__ == 6))
# define ASIO_HAS_STD_CHRONO_MONOTONIC_CLOCK # define ASIO_HAS_STD_CHRONO_MONOTONIC_CLOCK
# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ == 6))
# endif // defined(__GXX_EXPERIMENTAL_CXX0X__) # endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
# endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4) # endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4)
# endif // defined(__GNUC__) # endif // defined(__GNUC__)

View File

@ -30,7 +30,7 @@ namespace detail {
class netdb_category : public asio::error_category class netdb_category : public asio::error_category
{ {
public: public:
const char* name() const const char* name() const ASIO_ERROR_CATEGORY_NOEXCEPT
{ {
return "asio.netdb"; return "asio.netdb";
} }
@ -62,7 +62,7 @@ namespace detail {
class addrinfo_category : public asio::error_category class addrinfo_category : public asio::error_category
{ {
public: public:
const char* name() const const char* name() const ASIO_ERROR_CATEGORY_NOEXCEPT
{ {
return "asio.addrinfo"; return "asio.addrinfo";
} }
@ -92,7 +92,7 @@ namespace detail {
class misc_category : public asio::error_category class misc_category : public asio::error_category
{ {
public: public:
const char* name() const const char* name() const ASIO_ERROR_CATEGORY_NOEXCEPT
{ {
return "asio.misc"; return "asio.misc";
} }

View File

@ -34,7 +34,7 @@ namespace detail {
class system_category : public error_category class system_category : public error_category
{ {
public: public:
const char* name() const const char* name() const ASIO_ERROR_CATEGORY_NOEXCEPT
{ {
return "asio.system"; return "asio.system";
} }

View File

@ -29,7 +29,7 @@ namespace detail {
class ssl_category : public asio::error_category class ssl_category : public asio::error_category
{ {
public: public:
const char* name() const const char* name() const ASIO_ERROR_CATEGORY_NOEXCEPT
{ {
return "asio.ssl"; return "asio.ssl";
} }

View File

@ -23,6 +23,8 @@
* Improved the performance of strand rescheduling. * Improved the performance of strand rescheduling.
* Added support for [^g++] 4.7 when compiling in C++11 mode.
[heading Asio 1.8.0] [heading Asio 1.8.0]
* Added a new class template `basic_waitable_timer` based around the C++11 clock * Added a new class template `basic_waitable_timer` based around the C++11 clock