Merge pull request #2933 from cesanta/win_rng

Windows: added alternative to bcrypt lib
This commit is contained in:
Sergey Lyubka authored and GitHub committed 2024-10-29 15:44:05 +00:00
commit 9aef821862
4 files changed
+26 -26

No files matched your search

+4 -5
View File
@@ -415,6 +415,10 @@ static inline int mg_mkdir(const char *path, mode_t mode) {
#if MG_ARCH == MG_ARCH_WIN32
#ifndef _CRT_RAND_S
#define _CRT_RAND_S
#endif
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
@@ -470,11 +474,6 @@ typedef enum { false = 0, true = 1 } bool;
#endif
#include <wincrypt.h>
#pragma comment(lib, "advapi32.lib")
#else
#include <bcrypt.h>
#if defined(_MSC_VER)
#pragma comment(lib, "bcrypt.lib")
#endif
#endif
// Protect from calls like std::snprintf in app code