diff options
author | H. Peter Anvin <hpa@zytor.com> | 2017-04-18 16:07:18 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2017-04-18 16:08:54 -0700 |
commit | c4d75ddcbfb9093cfec7a5e0623f4a4ece3a14d3 (patch) | |
tree | 6138fc70ea706e1345c934cd42c486ee872466c1 /include/nasmlib.h | |
parent | e558dfd2498f581125b14a2e7abbac27fe5e7515 (diff) | |
parent | b68edcac72dc490bfba50bc144c0c6cce8c17b25 (diff) | |
download | nasm-c4d75ddcbfb9093cfec7a5e0623f4a4ece3a14d3.tar.gz |
Merge branch 'master' into elf
Resolved Conflicts:
aclocal.m4
output/outelf.c
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'include/nasmlib.h')
-rw-r--r-- | include/nasmlib.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/nasmlib.h b/include/nasmlib.h index c705b501..16c0c8ca 100644 --- a/include/nasmlib.h +++ b/include/nasmlib.h @@ -97,12 +97,14 @@ char * safe_alloc nasm_strndup(const char *, size_t); nasm_free(*_pp); \ *_pp = NULL; \ } while (0) -#define nasm_zero(p) (memset((p), 0, sizeof(*(p)))) +#define nasm_zero(x) (memset(&(x), 0, sizeof(x))) #define nasm_zeron(p,n) (memset((p), 0, (n)*sizeof(*(p)))) /* - * Wrapper around fwrite() which fatal-errors on output failure. + * Wrappers around fread()/fwrite() which fatal-errors on failure. + * For fread(), only use this if EOF is supposed to be a fatal error! */ +void nasm_read(void *, size_t, FILE *); void nasm_write(const void *, size_t, FILE *); /* @@ -133,6 +135,9 @@ no_return nasm_assert_failed(const char *, int, const char *); do { enum { _static_assert_failed = 1/(!!(x)) }; } while (0) #endif +/* Utility function to generate a string for an invalid enum */ +const char *invalid_enum_str(int); + /* * ANSI doesn't guarantee the presence of `stricmp' or * `strcasecmp'. |