From: Paul Eggert Date: Sun, 18 Dec 2022 07:45:56 +0000 (-0800) Subject: memset_explicit: port to older MS-Windows X-Git-Tag: v1.0~1941 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=5405c76d242b5b45ed867c3c5b31e291446b0790;p=gnulib.git memset_explicit: port to older MS-Windows * lib/memset_explicit.c (memset_explicit): Remove special case for C==0 and MS-Windows. The code isn’t needed for correctness and it’s more trouble than it’s worth as it prevents this module from being used with GNU Emacs, which wants to port to MS-Windows versions so old that they lack SecureZeroMemory. --- diff --git a/ChangeLog b/ChangeLog index 997faec27e..d7f0a62ed9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2022-12-17 Paul Eggert + + memset_explicit: port to older MS-Windows + * lib/memset_explicit.c (memset_explicit): + Remove special case for C==0 and MS-Windows. The code isn’t + needed for correctness and it’s more trouble than it’s worth as it + prevents this module from being used with GNU Emacs, which wants + to port to MS-Windows versions so old that they lack + SecureZeroMemory. + 2022-12-09 Bruno Haible Update users.txt. diff --git a/lib/memset_explicit.c b/lib/memset_explicit.c index 867391b80f..eabeb3ec2b 100644 --- a/lib/memset_explicit.c +++ b/lib/memset_explicit.c @@ -23,20 +23,11 @@ #include -#if defined _WIN32 && !defined __CYGWIN__ -# define WIN32_LEAN_AND_MEAN -# include -#endif - /* Set S's bytes to C, where S has LEN bytes. The compiler will not optimize effects away, even if S is dead after the call. */ void * memset_explicit (void *s, int c, size_t len) { -#if defined _WIN32 && !defined __CYGWIN__ - if (!c) - return SecureZeroMemory (s, len); -#endif #if HAVE_EXPLICIT_MEMSET return explicit_memset (s, c, len); #elif HAVE_MEMSET_S