From d33ad232ec108891088bb5f11cde63acfcb35cc3 Mon Sep 17 00:00:00 2001 From: Sami Vaarala Date: Fri, 21 Feb 2014 23:04:56 +0200 Subject: [PATCH] add DUK_MEMZERO() --- src/duk_features.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/duk_features.h b/src/duk_features.h index fb70a5b6..8a86f666 100644 --- a/src/duk_features.h +++ b/src/duk_features.h @@ -1057,6 +1057,8 @@ extern double duk_computed_nan; /* * ANSI C string/memory function wrapper defines to allow easier workarounds. + * Also convenience macros like DUK_MEMZERO which may be mapped to existing + * platform function to zero memory (like the deprecated bzero). * * For instance, some platforms don't support zero-size memcpy correctly, * some arcane uclibc versions have a buggy memcpy (but working memmove) @@ -1093,6 +1095,8 @@ extern double duk_computed_nan; #define DUK_SSCANF sscanf #define DUK_VSSCANF vsscanf +#define DUK_MEMZERO(p,n) DUK_MEMSET((p), 0, (n)) + /* * Macro hackery to convert e.g. __LINE__ to a string without formatting, * see: http://stackoverflow.com/questions/240353/convert-a-preprocessor-token-to-a-string