소스 검색

Fine, mingw! fine! are you happy now??

Nick Mathewson 9 년 전
부모
커밋
58cd21f601
1개의 변경된 파일6개의 추가작업 그리고 2개의 파일을 삭제
  1. 6 2
      src/common/compat.c

+ 6 - 2
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>