зеркало из https://github.com/github/ruby.git
explicit_bzero.c: needs windows.h
* missing/explicit_bzero.c, random.c (explicit_bzero): SecureZeroMemory() needs windows.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
e84000fcba
Коммит
24dcb1285d
|
@ -252,7 +252,7 @@ explicit_bzero_by_memset_s(void *b, size_t len)
|
|||
memset_s(b, len, 0, len);
|
||||
}
|
||||
# define explicit_bzero(b, len) explicit_bzero_by_memset_s(b, len)
|
||||
# elif defined _WIN32
|
||||
# elif defined SecureZeroMemory
|
||||
# define explicit_bzero(b, len) SecureZeroMemory(b, len)
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
#include "ruby/missing.h"
|
||||
#include <string.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
*BSD have explicit_bzero().
|
||||
Windows, OS-X have memset_s().
|
||||
|
@ -30,6 +34,8 @@ explicit_bzero(void *b, size_t len)
|
|||
{
|
||||
#ifdef HAVE_MEMSET_S
|
||||
memset_s(b, len, 0, len);
|
||||
#elif defined SecureZeroMemory
|
||||
SecureZeroMemory(b, len);
|
||||
#else
|
||||
{
|
||||
/*
|
||||
|
|
1
random.c
1
random.c
|
@ -89,6 +89,7 @@ The original copyright notice follows.
|
|||
# define _WIN32_WINNT 0x400
|
||||
# undef __WINCRYPT_H__
|
||||
# endif
|
||||
#include <windows.h>
|
||||
#include <wincrypt.h>
|
||||
#endif
|
||||
#include "ruby_atomic.h"
|
||||
|
|
|
@ -244,6 +244,7 @@ MISSING = crypt.obj ffs.obj langinfo.obj lgamma_r.obj strlcat.obj strlcpy.obj wi
|
|||
!if $(RT_VER) < 120
|
||||
MISSING = $(MISSING) acosh.obj cbrt.obj erf.obj tgamma.obj
|
||||
!endif
|
||||
MISSING = $(MISSING) explicit_bzero.obj
|
||||
!endif
|
||||
DLNOBJ = dln.obj
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче