nasmlib.h: add nasm_zeron()

Add a nasm_zeron() convenience macro to match nasm_zero(); compare
nasm_new() vs nasm_newn().

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin 2017-02-21 11:32:22 -08:00
parent d97cceed61
commit 90303022b4

View File

@ -172,6 +172,7 @@ char * safe_alloc nasm_strndup(const char *, size_t);
*_pp = NULL; \
} while (0)
#define nasm_zero(p) (memset((p), 0, sizeof(*(p))))
#define nasm_zeron(p,n) (memset((p), 0, (n)*sizeof(*(p))))
/*
* Wrapper around fwrite() which fatal-errors on output failure.