logsyserr(): no strerror_r on Windows

This commit is contained in:
Jean-Francois Dockes 2018-10-24 17:10:21 +02:00
parent 7f2b32bff6
commit 2fb61f2583

View File

@ -193,6 +193,12 @@ private:
#endif
#define LOGFATAL LOGFAT
#if defined(sun) || defined(_WIN32)
#define LOGSYSERR(who, what, arg) { \
LOGERR(who << ": " << what << "(" << arg << "): errno " << errno << \
": " << strerror(errno) << std::endl); \
}
#else // !WINDOWS->
#if (_POSIX_C_SOURCE >= 200112L) && ! _GNU_SOURCE
#define LOGSYSERR(who, what, arg) { \
char buf[200]; buf[0] = 0; strerror_r(errno, buf, 200); \
@ -206,4 +212,6 @@ private:
": " << strerror_r(errno, buf, 200) << std::endl); \
}
#endif
#endif // not windows
#endif /* _LOG_H_X_INCLUDED_ */