Skip to content

Commit 02c76ad

Browse files
committed
Merge bitcoin/bitcoin#26950: cleanse: switch to SecureZeroMemory for Windows cross-compile
c399c80 cleanse: Use SecureZeroMemory for mingw-w64 (release) builds (fanquake) Pull request description: This PR switches our Windows release builds to use the [`SecureZeroMemory()`](https://learn.microsoft.com/en-us/previous-versions/windows/desktop/legacy/aa366877(v=vs.85)) provided by mingw-w64. ACKs for top commit: sipa: utACK c399c80 TheCharlatan: ACK c399c80 Tree-SHA512: dbb20b16c85061d2f9408a3cf69cecc16765f8f61b25a1707146767b664c7ad0caf36975380814ef8e7c49a30199daebac6d5d7a3585354d1adac8e9770199c6
2 parents 5d28013 + c399c80 commit 02c76ad

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/support/cleanse.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77

88
#include <cstring>
99

10-
#if defined(_MSC_VER)
11-
#include <Windows.h> // For SecureZeroMemory.
10+
#if defined(WIN32)
11+
#include <windows.h>
1212
#endif
1313

1414
void memory_cleanse(void *ptr, size_t len)
1515
{
16-
#if defined(_MSC_VER)
17-
/* SecureZeroMemory is guaranteed not to be optimized out by MSVC. */
16+
#if defined(WIN32)
17+
/* SecureZeroMemory is guaranteed not to be optimized out. */
1818
SecureZeroMemory(ptr, len);
1919
#else
2020
std::memset(ptr, 0, len);

0 commit comments

Comments
 (0)