Skip to content

Commit

Permalink
Merge pull request #124 from Cgettys/add-unaligned-defined-guard
Browse files Browse the repository at this point in the history
Add !defined check on MINIZ_USE_ALIGNED_LOADS_AND_STORES
  • Loading branch information
uroni authored Mar 31, 2019
2 parents 25de35f + 5ba89c1 commit e902072
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions miniz.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,16 @@
#define MINIZ_LITTLE_ENDIAN 0
#endif

/* Set MINIZ_USE_UNALIGNED_LOADS_AND_STORES only if not set */
#if !defined(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
#define MINIZ_UNALIGNED_USE_MEMCPY
#else
#define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 0
#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 e902072

Please sign in to comment.