diff --git a/winpr/include/winpr/crt.h b/winpr/include/winpr/crt.h index 76237deb2..3603bf9a6 100644 --- a/winpr/include/winpr/crt.h +++ b/winpr/include/winpr/crt.h @@ -31,6 +31,12 @@ #ifndef _WIN32 +#include + +#ifndef _write +#define _write write +#endif + #ifndef _strtoui64 #define _strtoui64 strtoull #endif diff --git a/winpr/libwinpr/utils/debug.c b/winpr/libwinpr/utils/debug.c index 220ba57d1..d65e3c86a 100644 --- a/winpr/libwinpr/utils/debug.c +++ b/winpr/libwinpr/utils/debug.c @@ -22,6 +22,8 @@ #include #include + +#include #include #if defined(HAVE_EXECINFO_H) @@ -161,7 +163,7 @@ void winpr_backtrace_symbols_fd(void* buffer, int fd) return; for (i = 0; i < used; i++) - write(fd, lines[i], (unsigned)strnlen(lines[i], UINT32_MAX)); + _write(fd, lines[i], (unsigned)strnlen(lines[i], UINT32_MAX)); } #else LOGF(support_msg);