diff --git a/configure.ac b/configure.ac index 42681eb3ed..6acc587610 100644 --- a/configure.ac +++ b/configure.ac @@ -396,6 +396,7 @@ dnl Check for functions before libevent, since libevent-1.2 apparently dnl exports strlcpy without defining it in a header. AC_CHECK_FUNCS( + SecureZeroMemory \ _NSGetEnviron \ accept4 \ backtrace \ @@ -435,6 +436,7 @@ AC_CHECK_FUNCS( uname \ usleep \ vasprintf \ + _getwch \ _vscprintf ) diff --git a/src/common/compat.c b/src/common/compat.c index 7355d34ddd..34f6ea2ba3 100644 --- a/src/common/compat.c +++ b/src/common/compat.c @@ -72,6 +72,16 @@ #ifdef _WIN32 #include #include +/* Some mingw headers lack these. :p */ +#ifndef HAVE__GETWCH +wint_t _getwch(void); +#endif +#ifndef WEOF +#define WEOF (wchar_t)(0xFFFF) +#endif +#ifndef HAVE_SECUREZEROMEMORY +PVOID SecureZeroMemory(PVOID ptr, SIZE_T cnt); +#endif #elif defined(HAVE_READPASSPHRASE_H) #include #else