- Timestamp:
- 22/01/2012 16:26:38 (4 months ago)
- File:
-
- 1 edited
-
box/trunk/lib/common/Logging.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
box/trunk/lib/common/Logging.h
r2895 r3064 82 82 THROW_EXCEPTION_MESSAGE(exception, subtype, \ 83 83 BOX_FILE_MESSAGE(filename, message)) 84 85 inline std::string GetNativeErrorMessage()86 {87 #ifdef WIN3288 return GetErrorMessage(GetLastError());89 #else90 std::ostringstream _box_log_line;91 _box_log_line << std::strerror(errno) << " (" << errno << ")";92 return _box_log_line.str();93 #endif94 }95 84 96 85 #ifdef WIN32 … … 106 95 #define BOX_LOG_NATIVE_WARNING(stuff) BOX_LOG_WIN_WARNING(stuff) 107 96 #define BOX_WIN_ERRNO_MESSAGE(error_number, stuff) \ 108 stuff << ": " << GetErrorMessage(error_number) << " (" << error_number << ")"97 stuff << ": " << GetErrorMessage(error_number) 109 98 #define THROW_WIN_ERROR_NUMBER(message, error_number, exception, subtype) \ 110 99 THROW_EXCEPTION_MESSAGE(exception, subtype, \ … … 113 102 THROW_WIN_ERROR_NUMBER(BOX_FILE_MESSAGE(filename, message), \ 114 103 error_number, exception, subtype) 104 #define THROW_WIN_FILE_ERROR(message, filename, exception, subtype) \ 105 THROW_WIN_FILE_ERRNO(message, filename, GetLastError(), \ 106 exception, subtype) 115 107 #else 116 108 #define BOX_LOG_NATIVE_ERROR(stuff) BOX_LOG_SYS_ERROR(stuff) … … 118 110 #endif 119 111 120 #define BOX_LOG_SOCKET_ERROR(_type, _name, _port, stuff) \ 112 #ifdef WIN32 113 # define BOX_LOG_SOCKET_ERROR(_type, _name, _port, stuff) \ 114 BOX_LOG_WIN_ERROR_NUMBER(stuff << " (type " << _type << ", name " << \ 115 _name << ", port " << _port << ")", WSAGetLastError()) 116 #else 117 # define BOX_LOG_SOCKET_ERROR(_type, _name, _port, stuff) \ 121 118 BOX_LOG_NATIVE_ERROR(stuff << " (type " << _type << ", name " << \ 122 119 _name << ", port " << _port << ")") 120 #endif 123 121 124 122 #define BOX_FORMAT_HEX32(number) \
Note: See TracChangeset
for help on using the changeset viewer.
