Skip to content

Commit

Permalink
Modify STRICT_ALIGN because macro expansion w/defined is undefined
Browse files Browse the repository at this point in the history
Modify STRICT_ALIGN because macro expansion producing 'defined' has
undefined behavior.

closes #2042

Signed-off-by: Kevin Dalley <kevin@kelphead.org>
  • Loading branch information
nereocystis committed Oct 30, 2017
1 parent 0d43316 commit d9a79f7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion io/src/lzf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d9a79f7

Please sign in to comment.