Add helper to log Windows system errors
It will help to log errors returned by GetLastError() or WSAGetLastError(): - <https://docs.microsoft.com/en-us/windows/win32/api/errhandlingapi/nf-errhandlingapi-getlasterror> - <https://docs.microsoft.com/en-us/windows/win32/api/winsock/nf-winsock-wsagetlasterror> - <https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes#system-error-codes> Always log the errors in English to be able to read them in bug reports.
This commit is contained in:
@@ -26,4 +26,10 @@ sc_set_log_level(enum sc_log_level level);
|
||||
enum sc_log_level
|
||||
sc_get_log_level(void);
|
||||
|
||||
#ifdef _WIN32
|
||||
// Log system error (typically returned by GetLastError() or similar)
|
||||
bool
|
||||
sc_log_windows_error(const char *prefix, int error);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user