Skip to content

Commit

Permalink
miniz: disable unaligned stores to avoid strict aliasing warnings.
Browse files Browse the repository at this point in the history
mainstream miniz disabled it by default recently, too .
  • Loading branch information
sezero committed May 27, 2022
1 parent 49a3a55 commit 6809eaf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions IMG_png.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,7 @@ static int IMG_SavePNG_RW_libpng(SDL_Surface *surface, SDL_RWops *dst, int freed
#else
#define MINIZ_LITTLE_ENDIAN 0
#endif
#define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 0
#define MINIZ_SDL_NOUNUSED
#include "miniz.h"

Expand Down
2 changes: 2 additions & 0 deletions miniz.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,12 @@
#endif
#endif /**/

#ifndef MINIZ_USE_UNALIGNED_LOADS_AND_STORES
#if MINIZ_X86_OR_X64_CPU
// Set MINIZ_USE_UNALIGNED_LOADS_AND_STORES to 1 on CPU's that permit efficient integer loads and stores from unaligned addresses.
#define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 1
#endif
#endif /**/

#if defined(_M_X64) || defined(_WIN64) || defined(__MINGW64__) || defined(_LP64) || defined(__LP64__) || defined(__ia64__) || defined(__x86_64__)
// Set MINIZ_HAS_64BIT_REGISTERS to 1 if operations on 64-bit integers are reasonably fast (and don't involve compiler generated calls to helper functions).
Expand Down

0 comments on commit 6809eaf

Please sign in to comment.