[tor-commits] [tor/master] Nth time is maybe the charm for fixing windows readpassword build errors

nickm at torproject.org nickm at torproject.org
Sun Jul 12 18:34:15 UTC 2015


commit db88d91ebedd407531784cf7fa8df0bd4f1f4164
Author: Nick Mathewson <nickm at torproject.org>
Date:   Sun Jul 12 14:34:11 2015 -0400

    Nth time is maybe the charm for fixing windows readpassword build errors
---
 configure.ac        |   10 ++++++++--
 src/common/compat.c |    4 ++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index 6acc587..214b7e6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -396,7 +396,6 @@ 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 \
@@ -436,7 +435,6 @@ AC_CHECK_FUNCS(
         uname \
 	usleep \
         vasprintf \
-	_getwch \
 	_vscprintf
 )
 
@@ -445,6 +443,14 @@ if test "$bwin32" != true; then
   AC_CHECK_FUNCS(pthread_create)
 fi
 
+if test "$bwin32" = true; then
+  AC_CHECK_DECLS([SecureZeroMemory, _getwch], , , [
+#include <windows.h>
+#include <conio.h>
+#include <wchar.h>
+                 ])
+fi
+
 AM_CONDITIONAL(BUILD_READPASSPHRASE_C, test x$ac_cv_func_readpassphrase = xno && test $bwin32 = false)
 
 dnl ------------------------------------------------------
diff --git a/src/common/compat.c b/src/common/compat.c
index 9d01c9d..69c4705 100644
--- a/src/common/compat.c
+++ b/src/common/compat.c
@@ -73,13 +73,13 @@
 #include <conio.h>
 #include <wchar.h>
 /* Some mingw headers lack these. :p */
-#ifndef HAVE__GETWCH
+#ifndef HAVE_DECL__GETWCH
 wint_t _getwch(void);
 #endif
 #ifndef WEOF
 #define WEOF (wchar_t)(0xFFFF)
 #endif
-#ifndef HAVE_SECUREZEROMEMORY
+#ifndef HAVE_DECL_SECUREZEROMEMORY
 PVOID SecureZeroMemory(PVOID ptr, SIZE_T cnt);
 #endif
 #elif defined(HAVE_READPASSPHRASE_H)



More information about the tor-commits mailing list