summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-07-12 15:30:35 -0400
committerNick Mathewson <nickm@torproject.org>2015-07-12 15:30:35 -0400
commit58cd21f6014a9d8dcd54669fb7fcc760b33ca6b2 (patch)
tree6dedfc221a1d622947a6f62b311ee56b01153a94 /src/common
parent7ed477786cbbb3905117f8ae9f4ce8ca82e5446b (diff)
downloadtor-58cd21f6014a9d8dcd54669fb7fcc760b33ca6b2.tar.gz
tor-58cd21f6014a9d8dcd54669fb7fcc760b33ca6b2.zip
Fine, mingw! fine! are you happy now??
Diffstat (limited to 'src/common')
-rw-r--r--src/common/compat.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/common/compat.c b/src/common/compat.c
index 01eccaccdc..12ad52dbb8 100644
--- a/src/common/compat.c
+++ b/src/common/compat.c
@@ -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>