]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fine, mingw! fine! are you happy now??
authorNick Mathewson <nickm@torproject.org>
Sun, 12 Jul 2015 19:30:35 +0000 (15:30 -0400)
committerNick Mathewson <nickm@torproject.org>
Sun, 12 Jul 2015 19:30:35 +0000 (15:30 -0400)
src/common/compat.c

index 01eccaccdc0bc5f93c8a6a96d74b3ad06d4ac126..12ad52dbb8d9ac649586dc309a014244ae34e3c2 100644 (file)
@@ -80,8 +80,12 @@ wint_t _getwch(void);
 #define WEOF (wchar_t)(0xFFFF)
 #endif
 #if defined(HAVE_DECL_SECUREZEROMEMORY) && !HAVE_DECL_SECUREZEROMEMORY
-#define SecureZeroMemory RtlSecureZeroMemory
-PVOID WINAPI SecureZeroMemory(PVOID ptr, SIZE_T cnt);
+static void inline SecureZeroMemory(PVOID ptr, SIZE_T cnt)
+{
+  volatile char *vcptr = (volatile char*)ptr;
+  while (cnt--)
+    *vcptr++ = 0;
+}
 #endif
 #elif defined(HAVE_READPASSPHRASE_H)
 #include <readpassphrase.h>