From: Guido Draheim Date: Sat, 22 Mar 2008 20:50:46 +0000 (+0000) Subject: honor aligned-access check during configure time X-Git-Tag: v0.13.50~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=68219c7af572a504a8709f14f45f398f55154922;p=zziplib honor aligned-access check during configure time --- diff --git a/ChangeLog b/ChangeLog index 2128262..f397466 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-03-22 guidod + + * zzip/fetch.h: honor ZZIP_HAVE_ALIGNED_ACCESS_REQUIRED for the Linux bswap + optimization. See also 443880@bugs.debian "SIGBUS on Sparc". + 2008-03-03 guidod * TODO: update to recent problems. Need to check my mail stack next time. diff --git a/configure.ac b/configure.ac index 1e9521f..4149bea 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ AC_INIT(zziplib.spec) AC_PREREQ(2.49) AC_COPYRIGHT([Guido Draheim for ZZipLib.SF.net]) -AC_REVISION($Revision: 1.9 $) +AC_REVISION($Revision: 1.10 $) AC_CONFIG_AUX_DIR(uses) # ======================================================================= AC_CANONICAL_SYSTEM @@ -9,8 +9,8 @@ dnl AM_ENABLE_MULTILIB([Makefile],[$host]) AX_ENABLE_BUILDDIR_UNAME AC_SET_DEFAULT_PATHS_SYSTEM # ----------------------------------------------------------------------- -AC_ARG_ENABLE(thread-safe,AC_HELP_STRING( - [--disable-thread-safe],[disable thread-safe libtool option]) +AC_ARG_ENABLE([thread-safe], +AC_HELP_STRING([--disable-thread-safe],[disable thread-safe libtool option]) ,,[ enable_thread_safe="yes"]) THREAD_SAFE="" test "$enable_thread_safe" = "yes" && THREAD_SAFE="-thread-safe" diff --git a/zzip/fetch.h b/zzip/fetch.h index e2c5e9b..860260a 100644 --- a/zzip/fetch.h +++ b/zzip/fetch.h @@ -25,6 +25,11 @@ extern void __zzip_set64(zzip_byte_t * s, uint64_t v); #ifdef ZZIP_WORDS_BIGENDIAN # if defined bswap_16 && defined bswap_32 && defined bswap_64 /* i.e. linux */ +# ifndef ZZIP_HAVE_ALIGNED_ACCESS_REQUIRED +# define _ZZIP_USE_BSWAP +# endif +# endif +# ifdef _ZZIP_USE_BSWAP # define ZZIP_GET16(__p) bswap_16(*(uint16_t*)(__p)) # define ZZIP_GET32(__p) bswap_32(*(uint32_t*)(__p)) # define ZZIP_GET64(__p) bswap_64(*(uint64_t*)(__p)) diff --git a/zzip/memdisk.c b/zzip/memdisk.c index eba4fdb..b3bd709 100644 --- a/zzip/memdisk.c +++ b/zzip/memdisk.c @@ -63,10 +63,10 @@ typedef struct _zzip_extra_zip64 /*forward*/ -zzip__new__ static ZZIP_MEM_ENTRY *zzip_mem_entry_new(ZZIP_DISK * disk, - ZZIP_DISK_ENTRY * entry); -zzip__new__ static void zzip_mem_entry_free(ZZIP_MEM_ENTRY * - _zzip_restrict item); +static zzip__new__ ZZIP_MEM_ENTRY * +zzip_mem_entry_new(ZZIP_DISK * disk, ZZIP_DISK_ENTRY * entry); +static void +zzip_mem_entry_free(ZZIP_MEM_ENTRY * _zzip_restrict item); zzip__new__ ZZIP_MEM_DISK * zzip_mem_disk_new(void)