From d9a79f7c3941f2355a455748ef0c7808ba97f1e6 Mon Sep 17 00:00:00 2001 From: Kevin Dalley Date: Fri, 27 Oct 2017 17:12:27 -0700 Subject: [PATCH] Modify STRICT_ALIGN because macro expansion w/defined is undefined Modify STRICT_ALIGN because macro expansion producing 'defined' has undefined behavior. closes #2042 Signed-off-by: Kevin Dalley --- io/src/lzf.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/io/src/lzf.cpp b/io/src/lzf.cpp index 8d52387ea5d..af34210c601 100644 --- a/io/src/lzf.cpp +++ b/io/src/lzf.cpp @@ -54,7 +54,11 @@ typedef unsigned int LZF_HSLOT; typedef unsigned int LZF_STATE[1 << (HLOG)]; -#define STRICT_ALIGN !(defined(__i386) || defined (__amd64)) +#if !(defined(__i386) || defined (__amd64)) +# define STRICT_ALIGN 1 +#else +# define STRICT_ALIGN 0 +#endif #if !STRICT_ALIGN /* for unaligned accesses we need a 16 bit datatype. */ # if USHRT_MAX == 65535