ruby-changes:41420
From: nobu <ko1@a...>
Date: Sun, 10 Jan 2016 15:45:17 +0900 (JST)
Subject: [ruby-changes:41420] nobu:r53493 (trunk): missing.h: remove explicit_bzero_by_memset_s
nobu 2016-01-10 15:45:36 +0900 (Sun, 10 Jan 2016) New Revision: 53493 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=53493 Log: missing.h: remove explicit_bzero_by_memset_s * include/ruby/missing.h (explicit_bzero_by_memset_s): remove inline implementation by memset_s, which needs a macro before including headers and can cause problems in extension libraries by the order of the macro and headers. Modified files: trunk/ChangeLog trunk/include/ruby/missing.h trunk/missing/explicit_bzero.c Index: include/ruby/missing.h =================================================================== --- include/ruby/missing.h (revision 53492) +++ include/ruby/missing.h (revision 53493) @@ -18,10 +18,6 @@ extern "C" { https://github.com/ruby/ruby/blob/trunk/include/ruby/missing.h#L18 #endif #endif -#ifndef __STDC_WANT_LIB_EXT1__ -#define __STDC_WANT_LIB_EXT1__ 1 -#endif - #include "ruby/config.h" #include <stddef.h> #include <math.h> /* for INFINITY and NAN */ @@ -248,15 +244,7 @@ RUBY_EXTERN void setproctitle(const char https://github.com/ruby/ruby/blob/trunk/include/ruby/missing.h#L244 #ifndef HAVE_EXPLICIT_BZERO RUBY_EXTERN void explicit_bzero(void *b, size_t len); -# ifdef HAVE_MEMSET_S -# include <string.h> -static inline void -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 SecureZeroMemory +# if defined SecureZeroMemory # define explicit_bzero(b, len) SecureZeroMemory(b, len) # endif #endif Index: ChangeLog =================================================================== --- ChangeLog (revision 53492) +++ ChangeLog (revision 53493) @@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Sun Jan 10 15:45:10 2016 Nobuyoshi Nakada <nobu@r...> + + * include/ruby/missing.h (explicit_bzero_by_memset_s): remove + inline implementation by memset_s, which needs a macro before + including headers and can cause problems in extension libraries + by the order of the macro and headers. + Sun Jan 10 13:41:36 2016 Eric Wong <e@8...> * io.c (rb_deferr): remove long obsolete global Index: missing/explicit_bzero.c =================================================================== --- missing/explicit_bzero.c (revision 53492) +++ missing/explicit_bzero.c (revision 53493) @@ -1,5 +1,12 @@ https://github.com/ruby/ruby/blob/trunk/missing/explicit_bzero.c#L1 +#ifndef __STDC_WANT_LIB_EXT1__ +#define __STDC_WANT_LIB_EXT1__ 1 +#endif + #include "ruby/missing.h" #include <string.h> +#ifdef HAVE_MEMSET_S +# include <string.h> +#endif #ifdef _WIN32 #include <windows.h> -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/