Make error codes have implementation-defined values in the documentation.

This commit is contained in:
chris_kohlhoff 2005-11-15 03:36:18 +00:00
parent 4e8e92824e
commit d1dffe972c
2 changed files with 15 additions and 12 deletions

View File

@ -31,11 +31,11 @@ namespace asio {
#if defined(BOOST_WINDOWS)
# define ASIO_SOCKET_ERROR(e) WSA ## e
# define ASIO_NETDB_ERROR(e) WSA ## e
# define ASIO_WIN_OR_POSIX_ERROR(e_win, e_posix) e_win
# define ASIO_OS_ERROR(e_win, e_posix) e_win
#else
# define ASIO_SOCKET_ERROR(e) e
# define ASIO_NETDB_ERROR(e) 16384 + e
# define ASIO_WIN_OR_POSIX_ERROR(e_win, e_posix) e_posix
# define ASIO_OS_ERROR(e_win, e_posix) e_posix
#endif
/// The error class is used to encapsulate system error codes.
@ -74,7 +74,7 @@ public:
bad_descriptor = ASIO_SOCKET_ERROR(EBADF),
/// End of file or stream.
eof = ASIO_WIN_OR_POSIX_ERROR(ERROR_HANDLE_EOF, -1),
eof = ASIO_OS_ERROR(ERROR_HANDLE_EOF, -1),
/// Bad address.
fault = ASIO_SOCKET_ERROR(EFAULT),
@ -119,10 +119,10 @@ public:
no_host_data = ASIO_NETDB_ERROR(NO_DATA),
/// Cannot allocate memory.
no_memory = ASIO_WIN_OR_POSIX_ERROR(ERROR_OUTOFMEMORY, ENOMEM),
no_memory = ASIO_OS_ERROR(ERROR_OUTOFMEMORY, ENOMEM),
/// Operation not permitted.
no_permission = ASIO_WIN_OR_POSIX_ERROR(ERROR_ACCESS_DENIED, EPERM),
no_permission = ASIO_OS_ERROR(ERROR_ACCESS_DENIED, EPERM),
/// Protocol not available.
no_protocol_option = ASIO_SOCKET_ERROR(ENOPROTOOPT),
@ -140,8 +140,7 @@ public:
not_supported = ASIO_SOCKET_ERROR(EOPNOTSUPP),
/// Operation cancelled.
operation_aborted =
ASIO_WIN_OR_POSIX_ERROR(ERROR_OPERATION_ABORTED, ECANCELED),
operation_aborted = ASIO_OS_ERROR(ERROR_OPERATION_ABORTED, ECANCELED),
/// Cannot send after transport endpoint shutdown.
shut_down = ASIO_SOCKET_ERROR(ESHUTDOWN),
@ -153,7 +152,7 @@ public:
timed_out = ASIO_SOCKET_ERROR(ETIMEDOUT),
/// Resource temporarily unavailable.
try_again = ASIO_WIN_OR_POSIX_ERROR(ERROR_RETRY, EAGAIN),
try_again = ASIO_OS_ERROR(ERROR_RETRY, EAGAIN),
/// The socket is marked non-blocking and the requested operation would
/// block.
@ -318,7 +317,7 @@ Ostream& operator<<(Ostream& os, const error& e)
#undef ASIO_SOCKET_ERROR
#undef ASIO_NETDB_ERROR
#undef ASIO_WIN_OR_POSIX_ERROR
#undef ASIO_OS_ERROR
#include "asio/detail/pop_options.hpp"

View File

@ -860,13 +860,13 @@ ENABLE_PREPROCESSING = YES
# compilation will be performed. Macro expansion can be done in a controlled
# way by setting EXPAND_ONLY_PREDEF to YES.
MACRO_EXPANSION = NO
MACRO_EXPANSION = YES
# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
# then the macro expansion is limited to the macros specified with the
# PREDEFINED and EXPAND_AS_PREDEFINED tags.
EXPAND_ONLY_PREDEF = NO
EXPAND_ONLY_PREDEF = YES
# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
# in the INCLUDE_PATH (see below) will be search if a #include is found.
@ -892,7 +892,11 @@ INCLUDE_FILE_PATTERNS =
# or name=definition (no spaces). If the definition and the = are
# omitted =1 is assumed.
PREDEFINED = GENERATING_DOCUMENTATION
PREDEFINED = \
GENERATING_DOCUMENTATION \
"ASIO_SOCKET_ERROR(e)=implementation_defined" \
"ASIO_NETDB_ERROR(e)=implementation_defined" \
"ASIO_OS_ERROR(e1,e2)=implementation_defined"
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded.