diff options
| author | Aaron Clauson <[email protected]> | 2017-11-10 07:06:49 +1100 |
|---|---|---|
| committer | Aaron Clauson <[email protected]> | 2017-11-10 07:06:49 +1100 |
| commit | fbf327b13868861c2877c5754caf5a9816f2603c (patch) | |
| tree | c8fe180d7a8ad74859dfcf28e0f4de96eb2ab4e7 /src/support | |
| parent | Merge #11580: Do not send (potentially) invalid headers in response to gethea... (diff) | |
| download | discoin-fbf327b13868861c2877c5754caf5a9816f2603c.tar.xz discoin-fbf327b13868861c2877c5754caf5a9816f2603c.zip | |
Minimal code changes to allow msvc compilation.
Diffstat (limited to 'src/support')
| -rw-r--r-- | src/support/cleanse.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/support/cleanse.cpp b/src/support/cleanse.cpp index 95899c9f0..eb6e0a73a 100644 --- a/src/support/cleanse.cpp +++ b/src/support/cleanse.cpp @@ -7,6 +7,10 @@ #include <cstring> +#if defined(_MSC_VER) +#include <Windows.h> // For SecureZeroMemory. +#endif + /* Compilers have a bad habit of removing "superfluous" memset calls that * are trying to zero memory. For example, when memset()ing a buffer and * then free()ing it, the compiler might decide that the memset is @@ -32,7 +36,7 @@ void memory_cleanse(void *ptr, size_t len) might try to eliminate "superfluous" memsets. If there's an easy way to detect memset_s, it would be better to use that. */ #if defined(_MSC_VER) - __asm; + SecureZeroMemory(ptr, len); #else __asm__ __volatile__("" : : "r"(ptr) : "memory"); #endif |