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:
parent
e84000fcba
commit
24dcb1285d
@ -252,7 +252,7 @@ explicit_bzero_by_memset_s(void *b, size_t len)
|
|||||||
memset_s(b, len, 0, len);
|
memset_s(b, len, 0, len);
|
||||||
}
|
}
|
||||||
# define explicit_bzero(b, len) explicit_bzero_by_memset_s(b, 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)
|
# define explicit_bzero(b, len) SecureZeroMemory(b, len)
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
#include "ruby/missing.h"
|
#include "ruby/missing.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include <windows.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*BSD have explicit_bzero().
|
*BSD have explicit_bzero().
|
||||||
Windows, OS-X have memset_s().
|
Windows, OS-X have memset_s().
|
||||||
@ -30,6 +34,8 @@ explicit_bzero(void *b, size_t len)
|
|||||||
{
|
{
|
||||||
#ifdef HAVE_MEMSET_S
|
#ifdef HAVE_MEMSET_S
|
||||||
memset_s(b, len, 0, len);
|
memset_s(b, len, 0, len);
|
||||||
|
#elif defined SecureZeroMemory
|
||||||
|
SecureZeroMemory(b, len);
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
1
random.c
1
random.c
@ -89,6 +89,7 @@ The original copyright notice follows.
|
|||||||
# define _WIN32_WINNT 0x400
|
# define _WIN32_WINNT 0x400
|
||||||
# undef __WINCRYPT_H__
|
# undef __WINCRYPT_H__
|
||||||
# endif
|
# endif
|
||||||
|
#include <windows.h>
|
||||||
#include <wincrypt.h>
|
#include <wincrypt.h>
|
||||||
#endif
|
#endif
|
||||||
#include "ruby_atomic.h"
|
#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
|
!if $(RT_VER) < 120
|
||||||
MISSING = $(MISSING) acosh.obj cbrt.obj erf.obj tgamma.obj
|
MISSING = $(MISSING) acosh.obj cbrt.obj erf.obj tgamma.obj
|
||||||
!endif
|
!endif
|
||||||
|
MISSING = $(MISSING) explicit_bzero.obj
|
||||||
!endif
|
!endif
|
||||||
DLNOBJ = dln.obj
|
DLNOBJ = dln.obj
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user