Add a thread-safe wxSysErrorMsgStr()
Implement wxSysErrorMsg's functionality without using static buffers; have the caller provide the buffer. When the caller uses the original API and does not provide a buffer, a static buffer is still used. wxSysErrorMsgStr() returns a wxString. Also use strerror_r() instead of strerror() on platforms other than MSW.
This commit is contained in:
@@ -1226,6 +1226,23 @@ unsigned long wxSysErrorCode();
|
||||
@a errCode is 0 (default), the last error code (as returned by
|
||||
wxSysErrorCode()) is used.
|
||||
|
||||
Use this function instead of wxSysErrorMsg(), as the latter one is not
|
||||
thread-safe.
|
||||
|
||||
@see wxSysErrorCode(), wxLogSysError()
|
||||
|
||||
@header{wx/log.h}
|
||||
*/
|
||||
wxString wxSysErrorMsgStr(unsigned long errCode = 0);
|
||||
|
||||
/**
|
||||
Returns the error message corresponding to the given system error code. If
|
||||
@a errCode is 0 (default), the last error code (as returned by
|
||||
wxSysErrorCode()) is used.
|
||||
|
||||
Use wxSysErrorMsgStr() instead of this function especially in a
|
||||
multi-threaded application.
|
||||
|
||||
@see wxSysErrorCode(), wxLogSysError()
|
||||
|
||||
@header{wx/log.h}
|
||||
|
Reference in New Issue
Block a user