]> granicus.if.org Git - zziplib/commitdiff
cleanup gcc4 signedness warnings
authorGuido Draheim <guidod@gmx.de>
Fri, 14 Oct 2005 21:49:13 +0000 (21:49 +0000)
committerGuido Draheim <guidod@gmx.de>
Fri, 14 Oct 2005 21:49:13 +0000 (21:49 +0000)
 (.)

16 files changed:
ChangeLog
bins/unzip-mem.c
uses/config.guess
uses/config.sub
uses/ltmain.sh
zzip/conf.h
zzip/fetch.h
zzip/format.h
zzip/fseeko.c
zzip/fseeko.h
zzip/memdisk.c
zzip/memdisk.h
zzip/mmapped.c
zzip/mmapped.h
zzip/types.h
zzip/zip.c

index 725cb8757f625b208f16872dbcc8a37c4c5ee66c..6a87df7ebec688c6cc7fcf5c322a4740c9dacc63 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2005-10-12
+ * MSVC7 knows the following __declspec attributes:
+       align(#), allocate("seg"), deprecated, dllexport, dllimport,
+       naked{for asm}, noinline, noreturn, nothrow, novtable,
+       property{MngC++}, selectany{common}, thread{tls}, uuid("name")
+ * introduce zzip__new__ for a restrict'ed return item
+ * introduce zzip_byte_t to help silence down compiler warnings
+       about signedness mismatch in assigning data buffer variables.
+       Especially the zlib data_in happens to be of unsigned char type.
+ * note that zzip/format.h does now use zzip_byte_t for layout definition
+
 2005-02-17
  * adding that _GNU_SOURCE on __linux__ to get the strndup prototype
  * cleaning a few warning messages on different platforms as well
index f4ce5e9e9684496ee464f6c07b49bcfed8acb664..3186544297284131300c7827602c0e6f3803ee54 100644 (file)
@@ -123,7 +123,7 @@ static void zzip_mem_entry_test(ZZIP_MEM_DISK* disk,
     if (file) 
     {
        unsigned long crc = crc32 (0L, NULL, 0);
-       char buffer[1024]; int len; 
+       unsigned char buffer[1024]; int len; 
        while ((len = zzip_mem_disk_fread (buffer, 1024, 1, file))) {
            crc = crc32 (crc, buffer, len);
        }
index d949270a589bc74385bf4a9effc8eefd86c11daa..910f4ee342a162cd09699be7daf909e91647d238 100755 (executable)
@@ -1,9 +1,9 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
-timestamp='2004-08-11'
+timestamp='2005-07-08'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -17,13 +17,15 @@ timestamp='2004-08-11'
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
 # the same distribution terms that you use for the rest of that program.
 
+
 # Originally written by Per Bothner <per@bothner.com>.
 # Please send patches to <config-patches@gnu.org>.  Submit a context
 # diff and a properly formatted ChangeLog entry.
@@ -53,7 +55,7 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
@@ -66,11 +68,11 @@ Try \`$me --help' for more information."
 while test $# -gt 0 ; do
   case $1 in
     --time-stamp | --time* | -t )
-       echo "$timestamp" ; exit ;;
+       echo "$timestamp" ; exit ;;
     --version | -v )
-       echo "$version" ; exit ;;
+       echo "$version" ; exit ;;
     --help | --h* | -h )
-       echo "$usage"; exit ;;
+       echo "$usage"; exit ;;
     -- )     # Stop option processing
        shift; break ;;
     - )        # Use stdin as input.
@@ -123,7 +125,7 @@ case $CC_FOR_BUILD,$HOST_CC,$CC in
        ;;
  ,,*)   CC_FOR_BUILD=$CC ;;
  ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
-esac ;'
+esac ; set_cc_for_build= ;'
 
 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
 # (ghazi@noc.rutgers.edu 1994-08-24)
@@ -206,64 +208,20 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        # contains redundant information, the shorter form:
        # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
        echo "${machine}-${os}${release}"
-       exit 0 ;;
-    amd64:OpenBSD:*:*)
-       echo x86_64-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    amiga:OpenBSD:*:*)
-       echo m68k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    arc:OpenBSD:*:*)
-       echo mipsel-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    cats:OpenBSD:*:*)
-       echo arm-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    hp300:OpenBSD:*:*)
-       echo m68k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    luna88k:OpenBSD:*:*)
-       echo m88k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    mac68k:OpenBSD:*:*)
-       echo m68k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    macppc:OpenBSD:*:*)
-       echo powerpc-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    mvme68k:OpenBSD:*:*)
-       echo m68k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    mvme88k:OpenBSD:*:*)
-       echo m88k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    mvmeppc:OpenBSD:*:*)
-       echo powerpc-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    pmax:OpenBSD:*:*)
-       echo mipsel-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    sgi:OpenBSD:*:*)
-       echo mipseb-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    sun3:OpenBSD:*:*)
-       echo m68k-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
-    wgrisc:OpenBSD:*:*)
-       echo mipsel-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
+       exit ;;
     *:OpenBSD:*:*)
-       echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
-       exit 0 ;;
+       UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+       echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+       exit ;;
     *:ekkoBSD:*:*)
        echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     macppc:MirBSD:*:*)
        echo powerppc-unknown-mirbsd${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:MirBSD:*:*)
        echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     alpha:OSF1:*:*)
        case $UNAME_RELEASE in
        *4.0)
@@ -316,37 +274,43 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        # A Xn.n version is an unreleased experimental baselevel.
        # 1.2 uses "1.2" for uname -r.
        echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-       exit ;;
+       exit ;;
     Alpha\ *:Windows_NT*:*)
        # How do we know it's Interix rather than the generic POSIX subsystem?
        # Should we change UNAME_MACHINE based on the output of uname instead
        # of the specific Alpha model?
        echo alpha-pc-interix
-       exit ;;
+       exit ;;
     21064:Windows_NT:50:3)
        echo alpha-dec-winnt3.5
-       exit ;;
+       exit ;;
     Amiga*:UNIX_System_V:4.0:*)
        echo m68k-unknown-sysv4
-       exit 0;;
+       exit ;;
     *:[Aa]miga[Oo][Ss]:*:*)
        echo ${UNAME_MACHINE}-unknown-amigaos
-       exit ;;
+       exit ;;
     *:[Mm]orph[Oo][Ss]:*:*)
        echo ${UNAME_MACHINE}-unknown-morphos
-       exit ;;
+       exit ;;
     *:OS/390:*:*)
        echo i370-ibm-openedition
-       exit 0 ;;
+       exit ;;
+    *:z/VM:*:*)
+       echo s390-ibm-zvmoe
+       exit ;;
     *:OS400:*:*)
         echo powerpc-ibm-os400
-       exit ;;
+       exit ;;
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
        echo arm-acorn-riscix${UNAME_RELEASE}
-       exit 0;;
+       exit ;;
+    arm:riscos:*:*|arm:RISCOS:*:*)
+       echo arm-unknown-riscos
+       exit ;;
     SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
        echo hppa1.1-hitachi-hiuxmpp
-       exit 0;;
+       exit ;;
     Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
        # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
        if test "`(/bin/universe) 2>/dev/null`" = att ; then
@@ -354,32 +318,32 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        else
                echo pyramid-pyramid-bsd
        fi
-       exit ;;
+       exit ;;
     NILE*:*:*:dcosx)
        echo pyramid-pyramid-svr4
-       exit ;;
+       exit ;;
     DRS?6000:unix:4.0:6*)
        echo sparc-icl-nx6
-       exit ;;
-    DRS?6000:UNIX_SV:4.2*:7*)
+       exit ;;
+    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
        case `/usr/bin/uname -p` in
-           sparc) echo sparc-icl-nx7 && exit 0 ;;
+           sparc) echo sparc-icl-nx7; exit ;;
        esac ;;
     sun4H:SunOS:5.*:*)
        echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit ;;
+       exit ;;
     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
        echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit ;;
+       exit ;;
     i86pc:SunOS:5.*:*)
        echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit ;;
+       exit ;;
     sun4*:SunOS:6*:*)
        # According to config.sub, this is the proper way to canonicalize
        # SunOS6.  Hard to guess exactly what SunOS6 will be like, but
        # it's likely to be more like Solaris than SunOS4.
        echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit ;;
+       exit ;;
     sun4*:SunOS:*:*)
        case "`/usr/bin/arch -k`" in
            Series*|S4*)
@@ -388,10 +352,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        esac
        # Japanese Language versions have a version number like `4.1.3-JL'.
        echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
-       exit ;;
+       exit ;;
     sun3*:SunOS:*:*)
        echo m68k-sun-sunos${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     sun*:*:4.2BSD:*)
        UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
        test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
@@ -403,10 +367,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
                echo sparc-sun-sunos${UNAME_RELEASE}
                ;;
        esac
-       exit ;;
+       exit ;;
     aushp:SunOS:*:*)
        echo sparc-auspex-sunos${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     # The situation for MiNT is a little confusing.  The machine name
     # can be virtually everything (everything which is not
     # "atarist" or "atariste" at least should have a processor
@@ -417,40 +381,40 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     # be no problem.
     atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
         echo m68k-atari-mint${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
        echo m68k-atari-mint${UNAME_RELEASE}
-        exit ;;
+        exit ;;
     *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
         echo m68k-atari-mint${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
         echo m68k-milan-mint${UNAME_RELEASE}
-        exit ;;
+        exit ;;
     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
         echo m68k-hades-mint${UNAME_RELEASE}
-        exit ;;
+        exit ;;
     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
         echo m68k-unknown-mint${UNAME_RELEASE}
-        exit ;;
+        exit ;;
     m68k:machten:*:*)
        echo m68k-apple-machten${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     powerpc:machten:*:*)
        echo powerpc-apple-machten${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     RISC*:Mach:*:*)
        echo mips-dec-mach_bsd4.3
-       exit ;;
+       exit ;;
     RISC*:ULTRIX:*:*)
        echo mips-dec-ultrix${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     VAX*:ULTRIX*:*:*)
        echo vax-dec-ultrix${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     2020:CLIX:*:* | 2430:CLIX:*:*)
        echo clipper-intergraph-clix${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     mips:*:*:UMIPS | mips:*:*:RISCos)
        eval $set_cc_for_build
        sed 's/^        //' << EOF >$dummy.c
@@ -474,32 +438,33 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
          exit (-1);
        }
 EOF
-       $CC_FOR_BUILD -o $dummy $dummy.c \
-         && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
-         && exit 0
+       $CC_FOR_BUILD -o $dummy $dummy.c &&
+         dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+         SYSTEM_NAME=`$dummy $dummyarg` &&
+           { echo "$SYSTEM_NAME"; exit; }
        echo mips-mips-riscos${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     Motorola:PowerMAX_OS:*:*)
        echo powerpc-motorola-powermax
-       exit ;;
+       exit ;;
     Motorola:*:4.3:PL8-*)
        echo powerpc-harris-powermax
-       exit ;;
+       exit ;;
     Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
        echo powerpc-harris-powermax
-       exit ;;
+       exit ;;
     Night_Hawk:Power_UNIX:*:*)
        echo powerpc-harris-powerunix
-       exit ;;
+       exit ;;
     m88k:CX/UX:7*:*)
        echo m88k-harris-cxux7
-       exit ;;
+       exit ;;
     m88k:*:4*:R4*)
        echo m88k-motorola-sysv4
-       exit ;;
+       exit ;;
     m88k:*:3*:R3*)
        echo m88k-motorola-sysv3
-       exit ;;
+       exit ;;
     AViiON:dgux:*:*)
         # DG/UX returns AViiON for all architectures
         UNAME_PROCESSOR=`/usr/bin/uname -p`
@@ -515,29 +480,29 @@ EOF
        else
            echo i586-dg-dgux${UNAME_RELEASE}
        fi
-       exit ;;
+       exit ;;
     M88*:DolphinOS:*:*)        # DolphinOS (SVR3)
        echo m88k-dolphin-sysv3
-       exit ;;
+       exit ;;
     M88*:*:R3*:*)
        # Delta 88k system running SVR3
        echo m88k-motorola-sysv3
-       exit ;;
+       exit ;;
     XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
        echo m88k-tektronix-sysv3
-       exit ;;
+       exit ;;
     Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
        echo m68k-tektronix-bsd
-       exit ;;
+       exit ;;
     *:IRIX*:*:*)
        echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
-       exit ;;
+       exit ;;
     ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
-       echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
-       exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
+       echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
+       exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
     i*86:AIX:*:*)
        echo i386-ibm-aix
-       exit ;;
+       exit ;;
     ia64:AIX:*:*)
        if [ -x /usr/bin/oslevel ] ; then
                IBM_REV=`/usr/bin/oslevel`
@@ -545,7 +510,7 @@ EOF
                IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
        fi
        echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
-       exit ;;
+       exit ;;
     *:AIX:2:3)
        if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
                eval $set_cc_for_build
@@ -560,14 +525,18 @@ EOF
                        exit(0);
                        }
 EOF
-               $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
-               echo rs6000-ibm-aix3.2.5
+               if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+               then
+                       echo "$SYSTEM_NAME"
+               else
+                       echo rs6000-ibm-aix3.2.5
+               fi
        elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
                echo rs6000-ibm-aix3.2.4
        else
                echo rs6000-ibm-aix3.2
        fi
-       exit ;;
+       exit ;;
     *:AIX:*:[45])
        IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
        if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
@@ -581,28 +550,28 @@ EOF
                IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
        fi
        echo ${IBM_ARCH}-ibm-aix${IBM_REV}
-       exit ;;
+       exit ;;
     *:AIX:*:*)
        echo rs6000-ibm-aix
-       exit ;;
+       exit ;;
     ibmrt:4.4BSD:*|romp-ibm:BSD:*)
        echo romp-ibm-bsd4.4
-       exit ;;
+       exit ;;
     ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
        echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
-       exit 0 ;;                           # report: romp-ibm BSD 4.3
+       exit ;;                             # report: romp-ibm BSD 4.3
     *:BOSX:*:*)
        echo rs6000-bull-bosx
-       exit ;;
+       exit ;;
     DPX/2?00:B.O.S.:*:*)
        echo m68k-bull-sysv3
-       exit ;;
+       exit ;;
     9000/[34]??:4.3bsd:1.*:*)
        echo m68k-hp-bsd
-       exit ;;
+       exit ;;
     hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
        echo m68k-hp-bsd4.4
-       exit ;;
+       exit ;;
     9000/[34678]??:HP-UX:*:*)
        HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
        case "${UNAME_MACHINE}" in
@@ -664,9 +633,19 @@ EOF
        esac
        if [ ${HP_ARCH} = "hppa2.0w" ]
        then
-           # avoid double evaluation of $set_cc_for_build
-           test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
-           if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
+           eval $set_cc_for_build
+
+           # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+           # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
+           # generating 64-bit code.  GNU and HP use different nomenclature:
+           #
+           # $ CC_FOR_BUILD=cc ./config.guess
+           # => hppa2.0w-hp-hpux11.23
+           # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+           # => hppa64-hp-hpux11.23
+
+           if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+               grep __LP64__ >/dev/null
            then
                HP_ARCH="hppa2.0w"
            else
@@ -674,11 +653,11 @@ EOF
            fi
        fi
        echo ${HP_ARCH}-hp-hpux${HPUX_REV}
-       exit ;;
+       exit ;;
     ia64:HP-UX:*:*)
        HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
        echo ia64-hp-hpux${HPUX_REV}
-       exit ;;
+       exit ;;
     3050*:HI-UX:*:*)
        eval $set_cc_for_build
        sed 's/^        //' << EOF >$dummy.c
@@ -706,152 +685,166 @@ EOF
          exit (0);
        }
 EOF
-       $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+       $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+               { echo "$SYSTEM_NAME"; exit; }
        echo unknown-hitachi-hiuxwe2
-       exit ;;
+       exit ;;
     9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
        echo hppa1.1-hp-bsd
-       exit ;;
+       exit ;;
     9000/8??:4.3bsd:*:*)
        echo hppa1.0-hp-bsd
-       exit ;;
+       exit ;;
     *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
        echo hppa1.0-hp-mpeix
-       exit ;;
+       exit ;;
     hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
        echo hppa1.1-hp-osf
-       exit ;;
+       exit ;;
     hp8??:OSF1:*:*)
        echo hppa1.0-hp-osf
-       exit ;;
+       exit ;;
     i*86:OSF1:*:*)
        if [ -x /usr/sbin/sysversion ] ; then
            echo ${UNAME_MACHINE}-unknown-osf1mk
        else
            echo ${UNAME_MACHINE}-unknown-osf1
        fi
-       exit ;;
+       exit ;;
     parisc*:Lites*:*:*)
        echo hppa1.1-hp-lites
-       exit ;;
+       exit ;;
     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
        echo c1-convex-bsd
-        exit ;;
+        exit ;;
     C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
        if getsysinfo -f scalar_acc
        then echo c32-convex-bsd
        else echo c2-convex-bsd
        fi
-        exit ;;
+        exit ;;
     C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
        echo c34-convex-bsd
-        exit ;;
+        exit ;;
     C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
        echo c38-convex-bsd
-        exit ;;
+        exit ;;
     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
        echo c4-convex-bsd
-        exit ;;
+        exit ;;
     CRAY*Y-MP:*:*:*)
        echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit ;;
+       exit ;;
     CRAY*[A-Z]90:*:*:*)
        echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
        | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
              -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
              -e 's/\.[^.]*$/.X/'
-       exit ;;
+       exit ;;
     CRAY*TS:*:*:*)
        echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit ;;
+       exit ;;
     CRAY*T3E:*:*:*)
        echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit ;;
+       exit ;;
     CRAY*SV1:*:*:*)
        echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit ;;
+       exit ;;
     *:UNICOS/mp:*:*)
        echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-       exit ;;
+       exit ;;
     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
        FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
         FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
         FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
         echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-        exit ;;
+        exit ;;
     5000:UNIX_System_V:4.*:*)
         FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
         FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
         echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-       exit ;;
+       exit ;;
     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
        echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     sparc*:BSD/OS:*:*)
        echo sparc-unknown-bsdi${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:BSD/OS:*:*)
        echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:FreeBSD:*:*)
        echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
-       exit ;;
+       exit ;;
     i*:CYGWIN*:*)
        echo ${UNAME_MACHINE}-pc-cygwin
-       exit ;;
+       exit ;;
     i*:MINGW*:*)
        echo ${UNAME_MACHINE}-pc-mingw32
-       exit 0 ;;
+       exit ;;
+    i*:windows32*:*)
+       # uname -m includes "-pc" on this system.
+       echo ${UNAME_MACHINE}-mingw32
+       exit ;;
     i*:PW*:*)
        echo ${UNAME_MACHINE}-pc-pw32
-       exit ;;
+       exit ;;
     x86:Interix*:[34]*)
        echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
-       exit ;;
+       exit ;;
     [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
        echo i${UNAME_MACHINE}-pc-mks
-       exit ;;
+       exit ;;
     i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
        # How do we know it's Interix rather than the generic POSIX subsystem?
        # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
        # UNAME_MACHINE based on the output of uname instead of i386?
        echo i586-pc-interix
-       exit ;;
+       exit ;;
     i*:UWIN*:*)
        echo ${UNAME_MACHINE}-pc-uwin
-       exit 0 ;;
+       exit ;;
+    amd64:CYGWIN*:*:*)
+       echo x86_64-unknown-cygwin
+       exit ;;
     p*:CYGWIN*:*)
        echo powerpcle-unknown-cygwin
-       exit ;;
+       exit ;;
     prep*:SunOS:5.*:*)
        echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit ;;
+       exit ;;
     *:GNU:*:*)
        # the GNU system
        echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
-       exit ;;
+       exit ;;
     *:GNU/*:*:*)
        # other systems with GNU libc and userland
        echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
-       exit ;;
+       exit ;;
     i*86:Minix:*:*)
        echo ${UNAME_MACHINE}-pc-minix
-       exit ;;
+       exit ;;
     arm*:Linux:*:*)
        echo ${UNAME_MACHINE}-${VENDOR}-linux
-       exit ;;
+       exit ;;
     cris:Linux:*:*)
        echo cris-axis-linux
-       exit 0 ;;
+       exit ;;
+    crisv32:Linux:*:*)
+       echo crisv32-axis-linux
+       exit ;;
+    frv:Linux:*:*)
+       echo frv-${VENDOR}-linux
+       exit ;;
     ia64:Linux:*:*)
        echo ${UNAME_MACHINE}-${VENDOR}-linux
-       exit ;;
+       exit ;;
     m32r*:Linux:*:*)
        echo ${UNAME_MACHINE}-${VENDOR}-linux
-       exit ;;
+       exit ;;
     m68*:Linux:*:*)
        echo ${UNAME_MACHINE}-${VENDOR}-linux
-       exit ;;
+       exit ;;
     mips:Linux:*:*)
        eval $set_cc_for_build
        sed 's/^        //' << EOF >$dummy.c
@@ -869,7 +862,7 @@ EOF
        #endif
 EOF
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
-       test x"${CPU}" != x && echo "${CPU}-${VENDOR}-linux" && exit 0
+       test x"${CPU}" != x && { echo "${CPU}-${VENDOR}-linux"; exit; }
        ;;
     mips64:Linux:*:*)
        eval $set_cc_for_build
@@ -888,14 +881,14 @@ EOF
        #endif
 EOF
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
-       test x"${CPU}" != x && echo "${CPU}-${VENDOR}-linux" && exit 0
+       test x"${CPU}" != x && { echo "${CPU}-${VENDOR}-linux"; exit; }
        ;;
     ppc:Linux:*:*)
        echo powerpc-${VENDOR}-linux
-       exit ;;
+       exit ;;
     ppc64:Linux:*:*)
        echo powerpc64-${VENDOR}-linux
-       exit ;;
+       exit ;;
     alpha:Linux:*:*)
        case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
          EV5)   UNAME_MACHINE=alphaev5 ;;
@@ -907,9 +900,9 @@ EOF
          EV68*) UNAME_MACHINE=alphaev68 ;;
         esac
        objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
-       if test "$?" = 0 ; then LIBC="-libc1" ; else LIBC="" ; fi
+       if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
        echo ${UNAME_MACHINE}-${VENDOR}-linux${LIBC}
-       exit ;;
+       exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
        # Look for CPU level
        case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
@@ -917,25 +910,25 @@ EOF
          PA8*) echo hppa2.0-${VENDOR}-linux ;;
          *)    echo hppa-${VENDOR}-linux ;;
        esac
-       exit ;;
+       exit ;;
     parisc64:Linux:*:* | hppa64:Linux:*:*)
        echo hppa64-${VENDOR}-linux
-       exit ;;
+       exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
        echo ${UNAME_MACHINE}-ibm-linux
-       exit ;;
+       exit ;;
     sh64*:Linux:*:*)
        echo ${UNAME_MACHINE}-${VENDOR}-linux
-       exit ;;
+       exit ;;
     sh*:Linux:*:*)
        echo ${UNAME_MACHINE}-${VENDOR}-linux
-       exit ;;
+       exit ;;
     sparc:Linux:*:* | sparc64:Linux:*:*)
        echo ${UNAME_MACHINE}-${VENDOR}-linux
-       exit ;;
+       exit ;;
     x86_64:Linux:*:*)
        echo x86_64-${VENDOR}-linux
-       exit ;;
+       exit ;;
     i*86:Linux:*:*)
        # The BFD linker knows what the default object file format is, so
        # first see if it will tell us. cd to the root directory to prevent
@@ -953,15 +946,15 @@ EOF
                ;;
          a.out-i386-linux)
                echo "${UNAME_MACHINE}-${VENDOR}-linuxaout"
-               exit ;;
+               exit ;;
          coff-i386)
                echo "${UNAME_MACHINE}-${VENDOR}-linuxcoff"
-               exit ;;
+               exit ;;
          "")
                # Either a pre-BFD a.out linker (linuxoldld) or
                # one that does not give us useful --help.
                echo "${UNAME_MACHINE}-${VENDOR}-linuxoldld"
-               exit ;;
+               exit ;;
        esac
        # Determine whether the default compiler is a.out or elf
        eval $set_cc_for_build
@@ -989,15 +982,18 @@ EOF
        #endif
 EOF
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
-       test x"${LIBC}" != x && echo "${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}" | sed 's/linux-gnu/linux/' && exit 0
-       test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
+       test x"${LIBC}" != x && {
+               echo "${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}" | sed 's/linux-gnu/linux/'
+               exit
+       }
+       test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
        ;;
     i*86:DYNIX/ptx:4*:*)
        # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
        # earlier versions are messed up and put the nodename in both
        # sysname and nodename.
        echo i386-sequent-sysv4
-       exit ;;
+       exit ;;
     i*86:UNIX_SV:4.2MP:2.*)
         # Unixware is an offshoot of SVR4, but it has its own version
         # number series starting with 2...
@@ -1005,27 +1001,27 @@ EOF
        # I just have to hope.  -- rms.
         # Use sysv4.2uw... so that sysv4* matches it.
        echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
-       exit ;;
+       exit ;;
     i*86:OS/2:*:*)
        # If we were able to find `uname', then EMX Unix compatibility
        # is probably installed.
        echo ${UNAME_MACHINE}-pc-os2-emx
-       exit ;;
+       exit ;;
     i*86:XTS-300:*:STOP)
        echo ${UNAME_MACHINE}-unknown-stop
-       exit ;;
+       exit ;;
     i*86:atheos:*:*)
        echo ${UNAME_MACHINE}-unknown-atheos
-       exit ;;
-       i*86:syllable:*:*)
+       exit ;;
+    i*86:syllable:*:*)
        echo ${UNAME_MACHINE}-pc-syllable
-       exit ;;
+       exit ;;
     i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
        echo i386-unknown-lynxos${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     i*86:*DOS:*:*)
        echo ${UNAME_MACHINE}-pc-msdosdjgpp
-       exit ;;
+       exit ;;
     i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
        UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
        if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
@@ -1033,15 +1029,16 @@ EOF
        else
                echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
        fi
-       exit 0 ;;
-    i*86:*:5:[78]*)
+       exit ;;
+    i*86:*:5:[678]*)
+       # UnixWare 7.x, OpenUNIX and OpenServer 6.
        case `/bin/uname -X | grep "^Machine"` in
            *486*)           UNAME_MACHINE=i486 ;;
            *Pentium)        UNAME_MACHINE=i586 ;;
            *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
        esac
        echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
-       exit ;;
+       exit ;;
     i*86:*:3.2:*)
        if test -f /usr/options/cb.name; then
                UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
@@ -1059,73 +1056,73 @@ EOF
        else
                echo ${UNAME_MACHINE}-pc-sysv32
        fi
-       exit ;;
+       exit ;;
     pc:*:*:*)
        # Left here for compatibility:
         # uname -m prints for DJGPP always 'pc', but it prints nothing about
         # the processor, so we play safe by assuming i386.
        echo i386-pc-msdosdjgpp
-        exit ;;
+        exit ;;
     Intel:Mach:3*:*)
        echo i386-pc-mach3
-       exit ;;
+       exit ;;
     paragon:*:*:*)
        echo i860-intel-osf1
-       exit ;;
+       exit ;;
     i860:*:4.*:*) # i860-SVR4
        if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
          echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
        else # Add other i860-SVR4 vendors below as they are discovered.
          echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
        fi
-       exit ;;
+       exit ;;
     mini*:CTIX:SYS*5:*)
        # "miniframe"
        echo m68010-convergent-sysv
-       exit ;;
+       exit ;;
     mc68k:UNIX:SYSTEM5:3.51m)
        echo m68k-convergent-sysv
-       exit ;;
+       exit ;;
     M680?0:D-NIX:5.3:*)
        echo m68k-diab-dnix
-       exit ;;
+       exit ;;
     M68*:*:R3V[5678]*:*)
-       test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
+       test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
     3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
        OS_REL=''
        test -r /etc/.relid \
        && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-         && echo i486-ncr-sysv4.3${OS_REL} && exit 0
+         && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
        /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-         && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
+         && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
         /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-          && echo i486-ncr-sysv4 && exit 0 ;;
+          && { echo i486-ncr-sysv4; exit; } ;;
     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
        echo m68k-unknown-lynxos${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     mc68030:UNIX_System_V:4.*:*)
        echo m68k-atari-sysv4
-       exit ;;
+       exit ;;
     TSUNAMI:LynxOS:2.*:*)
        echo sparc-unknown-lynxos${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     rs6000:LynxOS:2.*:*)
        echo rs6000-unknown-lynxos${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
        echo powerpc-unknown-lynxos${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     SM[BE]S:UNIX_SV:*:*)
        echo mips-dde-sysv${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     RM*:ReliantUNIX-*:*:*)
        echo mips-sni-sysv4
-       exit ;;
+       exit ;;
     RM*:SINIX-*:*:*)
        echo mips-sni-sysv4
-       exit ;;
+       exit ;;
     *:SINIX-*:*:*)
        if uname -p 2>/dev/null >/dev/null ; then
                UNAME_MACHINE=`(uname -p) 2>/dev/null`
@@ -1133,61 +1130,65 @@ EOF
        else
                echo ns32k-sni-sysv
        fi
-       exit ;;
+       exit ;;
     PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
                       # says <Richard.M.Bartel@ccMail.Census.GOV>
         echo i586-unisys-sysv4
-        exit ;;
+        exit ;;
     *:UNIX_System_V:4*:FTX*)
        # From Gerald Hewes <hewes@openmarket.com>.
        # How about differentiating between stratus architectures? -djm
        echo hppa1.1-stratus-sysv4
-       exit ;;
+       exit ;;
     *:*:*:FTX*)
        # From seanf@swdc.stratus.com.
        echo i860-stratus-sysv4
-       exit 0 ;;
+       exit ;;
+    i*86:VOS:*:*)
+       # From Paul.Green@stratus.com.
+       echo ${UNAME_MACHINE}-stratus-vos
+       exit ;;
     *:VOS:*:*)
        # From Paul.Green@stratus.com.
        echo hppa1.1-stratus-vos
-       exit ;;
+       exit ;;
     mc68*:A/UX:*:*)
        echo m68k-apple-aux${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     news*:NEWS-OS:6*:*)
        echo mips-sony-newsos6
-       exit ;;
+       exit ;;
     R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
        if [ -d /usr/nec ]; then
                echo mips-nec-sysv${UNAME_RELEASE}
        else
                echo mips-unknown-sysv${UNAME_RELEASE}
        fi
-        exit ;;
+        exit ;;
     BeBox:BeOS:*:*)    # BeOS running on hardware made by Be, PPC only.
        echo powerpc-be-beos
-       exit ;;
+       exit ;;
     BeMac:BeOS:*:*)    # BeOS running on Mac or Mac clone, PPC only.
        echo powerpc-apple-beos
-       exit ;;
+       exit ;;
     BePC:BeOS:*:*)     # BeOS running on Intel PC compatible.
        echo i586-pc-beos
-       exit ;;
+       exit ;;
     SX-4:SUPER-UX:*:*)
        echo sx4-nec-superux${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     SX-5:SUPER-UX:*:*)
        echo sx5-nec-superux${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     SX-6:SUPER-UX:*:*)
        echo sx6-nec-superux${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     Power*:Rhapsody:*:*)
        echo powerpc-apple-rhapsody${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:Rhapsody:*:*)
        echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:Darwin:*:*)
        UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
        case $UNAME_PROCESSOR in
@@ -1195,7 +1196,7 @@ EOF
            unknown) UNAME_PROCESSOR=powerpc ;;
        esac
        echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:procnto*:*:* | *:QNX:[0123456789]*:*)
        UNAME_PROCESSOR=`uname -p`
        if test "$UNAME_PROCESSOR" = "x86"; then
@@ -1203,22 +1204,25 @@ EOF
                UNAME_MACHINE=pc
        fi
        echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:QNX:*:4*)
        echo i386-pc-qnx
-       exit 0 ;;
+       exit ;;
+    NSE-?:NONSTOP_KERNEL:*:*)
+       echo nse-tandem-nsk${UNAME_RELEASE}
+       exit ;;
     NSR-?:NONSTOP_KERNEL:*:*)
        echo nsr-tandem-nsk${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:NonStop-UX:*:*)
        echo mips-compaq-nonstopux
-       exit ;;
+       exit ;;
     BS2000:POSIX*:*:*)
        echo bs2000-siemens-sysv
-       exit ;;
+       exit ;;
     DS/*:UNIX_System_V:*:*)
        echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:Plan9:*:*)
        # "uname -m" is not consistent, so use $cputype instead. 386
        # is converted to i386 for consistency with other x86
@@ -1229,38 +1233,44 @@ EOF
            UNAME_MACHINE="$cputype"
        fi
        echo ${UNAME_MACHINE}-unknown-plan9
-       exit ;;
+       exit ;;
     *:TOPS-10:*:*)
        echo pdp10-unknown-tops10
-       exit ;;
+       exit ;;
     *:TENEX:*:*)
        echo pdp10-unknown-tenex
-       exit ;;
+       exit ;;
     KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
        echo pdp10-dec-tops20
-       exit ;;
+       exit ;;
     XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
        echo pdp10-xkl-tops20
-       exit ;;
+       exit ;;
     *:TOPS-20:*:*)
        echo pdp10-unknown-tops20
-       exit ;;
+       exit ;;
     *:ITS:*:*)
        echo pdp10-unknown-its
-       exit ;;
+       exit ;;
     SEI:*:*:SEIUX)
         echo mips-sei-seiux${UNAME_RELEASE}
-       exit ;;
+       exit ;;
     *:DragonFly:*:*)
        echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
-       exit ;;
+       exit ;;
     *:*VMS:*:*)
        UNAME_MACHINE=`(uname -p) 2>/dev/null`
        case "${UNAME_MACHINE}" in
-           A*) echo alpha-dec-vms && exit 0 ;;
-           I*) echo ia64-dec-vms && exit 0 ;;
-           V*) echo vax-dec-vms && exit 0 ;;
-       esac
+           A*) echo alpha-dec-vms ; exit ;;
+           I*) echo ia64-dec-vms ; exit ;;
+           V*) echo vax-dec-vms ; exit ;;
+       esac ;;
+    *:XENIX:*:SysV)
+       echo i386-pc-xenix
+       exit ;;
+    i*86:skyos:*:*)
+       echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+       exit ;;
 esac
 
 #echo '(No uname command or uname output not recognized.)' 1>&2
@@ -1292,7 +1302,7 @@ main ()
 #endif
 
 #if defined (__arm) && defined (__acorn) && defined (__unix)
-  printf ("arm-acorn-riscix"); exit (0);
+  printf ("arm-acorn-riscix\n"); exit (0);
 #endif
 
 #if defined (hp300) && !defined (hpux)
@@ -1381,11 +1391,12 @@ main ()
 }
 EOF
 
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+       { echo "$SYSTEM_NAME"; exit; }
 
 # Apollos put the system type in the environment.
 
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
 
 # Convex versions that predate uname can use getsysinfo(1)
 
@@ -1394,22 +1405,22 @@ then
     case `getsysinfo -f cpu_type` in
     c1*)
        echo c1-convex-bsd
-       exit ;;
+       exit ;;
     c2*)
        if getsysinfo -f scalar_acc
        then echo c32-convex-bsd
        else echo c2-convex-bsd
        fi
-       exit ;;
+       exit ;;
     c34*)
        echo c34-convex-bsd
-       exit ;;
+       exit ;;
     c38*)
        echo c38-convex-bsd
-       exit ;;
+       exit ;;
     c4*)
        echo c4-convex-bsd
-       exit ;;
+       exit ;;
     esac
 fi
 
@@ -1420,7 +1431,9 @@ This script, last modified $timestamp, has failed to recognize
 the operating system you are using. It is advised that you
 download the most up to date version of the config scripts from
 
-    ftp://ftp.gnu.org/pub/gnu/config/
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
+and
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
 
 If the version you run ($0) is already up to date, please
 send the following data and any information you think might be
index 236e424deb50d31551376e8a5eb4b46e34b552f1..6e2bdbf5a4b82f6c729a0758a37ad480fad72225 100755 (executable)
@@ -1,9 +1,9 @@
 #! /bin/sh
 # Configuration validation subroutine script.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
-timestamp='2004-06-24'
+timestamp='2005-07-08'
 
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
@@ -21,14 +21,15 @@ timestamp='2004-06-24'
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
 # the same distribution terms that you use for the rest of that program.
 
+
 # Please send patches to <config-patches@gnu.org>.  Submit a context
 # diff and a properly formatted ChangeLog entry.
 #
@@ -70,7 +71,7 @@ Report bugs and patches to <config-patches@gnu.org>."
 version="\
 GNU config.sub ($timestamp)
 
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
@@ -83,11 +84,11 @@ Try \`$me --help' for more information."
 while test $# -gt 0 ; do
   case $1 in
     --time-stamp | --time* | -t )
-       echo "$timestamp" ; exit ;;
+       echo "$timestamp" ; exit ;;
     --version | -v )
-       echo "$version" ; exit ;;
+       echo "$version" ; exit ;;
     --help | --h* | -h )
-       echo "$usage"; exit ;;
+       echo "$usage"; exit ;;
     -- )     # Stop option processing
        shift; break ;;
     - )        # Use stdin as input.
@@ -99,7 +100,7 @@ while test $# -gt 0 ; do
     *local*)
        # First pass through any local machine types.
        echo $1
-       exit 0;;
+       exit ;;
 
     * )
        break ;;
@@ -231,13 +232,14 @@ case $basic_machine in
        | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
        | am33_2.0 \
        | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+       | bfin \
        | c4x | clipper \
        | d10v | d30v | dlx | dsp16xx \
        | fr30 | frv \
        | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
        | i370 | i860 | i960 | ia64 \
        | ip2k | iq2000 \
-       | m32r | m32rle | m68000 | m68k | m88k | mcore \
+       | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \
        | mips | mipsbe | mipseb | mipsel | mipsle \
        | mips16 \
        | mips64 | mips64el \
@@ -246,6 +248,7 @@ case $basic_machine in
        | mips64vr4100 | mips64vr4100el \
        | mips64vr4300 | mips64vr4300el \
        | mips64vr5000 | mips64vr5000el \
+       | mips64vr5900 | mips64vr5900el \
        | mipsisa32 | mipsisa32el \
        | mipsisa32r2 | mipsisa32r2el \
        | mipsisa64 | mipsisa64el \
@@ -254,23 +257,28 @@ case $basic_machine in
        | mipsisa64sr71k | mipsisa64sr71kel \
        | mipstx39 | mipstx39el \
        | mn10200 | mn10300 \
+       | ms1 \
        | msp430 \
        | ns16k | ns32k \
-       | openrisc | or32 \
+       | or32 \
        | pdp10 | pdp11 | pj | pjl \
        | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
        | pyramid \
-       | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
+       | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
        | sh64 | sh64le \
-       | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \
+       | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \
+       | sparcv8 | sparcv9 | sparcv9b \
        | strongarm \
        | tahoe | thumb | tic4x | tic80 | tron \
        | v850 | v850e \
        | we32k \
-       | x86 | xscale | xstormy16 | xtensa \
+       | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
        | z8k)
                basic_machine=$basic_machine-unknown
                ;;
+       m32c)
+               basic_machine=$basic_machine-unknown
+               ;;
        m6811 | m68hc11 | m6812 | m68hc12)
                # Motorola 68HC11/12.
                basic_machine=$basic_machine-unknown
@@ -298,7 +306,7 @@ case $basic_machine in
        | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
        | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
        | avr-* \
-       | bs2000-* \
+       | bfin-* | bs2000-* \
        | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
        | clipper-* | craynv-* | cydra-* \
        | d10v-* | d30v-* | dlx-* \
@@ -310,7 +318,7 @@ case $basic_machine in
        | ip2k-* | iq2000-* \
        | m32r-* | m32rle-* \
        | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-       | m88110-* | m88k-* | mcore-* \
+       | m88110-* | m88k-* | maxq-* | mcore-* \
        | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
        | mips16-* \
        | mips64-* | mips64el-* \
@@ -319,6 +327,7 @@ case $basic_machine in
        | mips64vr4100-* | mips64vr4100el-* \
        | mips64vr4300-* | mips64vr4300el-* \
        | mips64vr5000-* | mips64vr5000el-* \
+       | mips64vr5900-* | mips64vr5900el-* \
        | mipsisa32-* | mipsisa32el-* \
        | mipsisa32r2-* | mipsisa32r2el-* \
        | mipsisa64-* | mipsisa64el-* \
@@ -327,6 +336,7 @@ case $basic_machine in
        | mipsisa64sr71k-* | mipsisa64sr71kel-* \
        | mipstx39-* | mipstx39el-* \
        | mmix-* \
+       | ms1-* \
        | msp430-* \
        | none-* | np1-* | ns16k-* | ns32k-* \
        | orion-* \
@@ -334,20 +344,23 @@ case $basic_machine in
        | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
        | pyramid-* \
        | romp-* | rs6000-* \
-       | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
+       | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \
        | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
-       | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
+       | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \
+       | sparclite-* \
        | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
        | tahoe-* | thumb-* \
        | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
        | tron-* \
        | v850-* | v850e-* | vax-* \
        | we32k-* \
-       | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
-       | xtensa-* \
+       | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \
+       | xstormy16-* | xtensa-* \
        | ymp-* \
        | z8k-*)
                ;;
+       m32c-*)
+               ;;
        # Recognize the various machine names and aliases which stand
        # for a CPU type and a company and sometimes even an OS.
        386bsd)
@@ -457,6 +470,9 @@ case $basic_machine in
        crds | unos)
                basic_machine=m68k-crds
                ;;
+       crisv32 | crisv32-* | etraxfs*)
+               basic_machine=crisv32-axis
+               ;;
        cris | cris-* | etrax*)
                basic_machine=cris-axis
                ;;
@@ -486,6 +502,10 @@ case $basic_machine in
                basic_machine=m88k-motorola
                os=-sysv3
                ;;
+       djgpp)
+               basic_machine=i586-pc
+               os=-msdosdjgpp
+               ;;
        dpx20 | dpx20-*)
                basic_machine=rs6000-bull
                os=-bosx
@@ -751,9 +771,8 @@ case $basic_machine in
                basic_machine=hppa1.1-oki
                os=-proelf
                ;;
-       or32 | or32-*)
+       openrisc | openrisc-*)
                basic_machine=or32-unknown
-               os=-coff
                ;;
        os400)
                basic_machine=powerpc-ibm
@@ -1026,6 +1045,10 @@ case $basic_machine in
                basic_machine=hppa1.1-winbond
                os=-proelf
                ;;
+       xbox)
+               basic_machine=i686-pc
+               os=-mingw32
+               ;;
        xps | xps100)
                basic_machine=xps100-honeywell
                ;;
@@ -1075,12 +1098,9 @@ case $basic_machine in
        we32k)
                basic_machine=we32k-att
                ;;
-       sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
+       sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
                basic_machine=sh-unknown
                ;;
-       sh64)
-               basic_machine=sh64-unknown
-               ;;
        sparc | sparcv8 | sparcv9 | sparcv9b)
                basic_machine=sparc-sun
                ;;
@@ -1167,7 +1187,8 @@ case $os in
              | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
              | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
              | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
-             | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*)
+             | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+             | -skyos* | -haiku*)
        # Remember, each alternative MUST END IN *, to match a version number.
                ;;
        -qnx*)
@@ -1185,7 +1206,7 @@ case $os in
                os=`echo $os | sed -e 's|nto|nto-qnx|'`
                ;;
        -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
-             | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
+             | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
              | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
                ;;
        -mac*)
@@ -1291,6 +1312,9 @@ case $os in
        -kaos*)
                os=-kaos
                ;;
+       -zvmoe)
+               os=-zvmoe
+               ;;
        -none)
                ;;
        *)
@@ -1368,6 +1392,9 @@ case $basic_machine in
        *-be)
                os=-beos
                ;;
+       *-haiku)
+               os=-haiku
+               ;;
        *-ibm)
                os=-aix
                ;;
@@ -1539,7 +1566,7 @@ case $basic_machine in
 esac
 
 echo $basic_machine$os
-exit 0
+exit
 
 # Local variables:
 # eval: (add-hook 'write-file-hooks 'time-stamp)
index a6d78e60821a7990fa6e6041946d9da896f3cc6e..eecedf23e43e65471b04172b7b9e74850db37891 100644 (file)
@@ -1,7 +1,7 @@
 # ltmain.sh - Provide generalized library-building support services.
 # NOTE: Changing this file will not affect anything until you rerun configure.
 #
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
 # Free Software Foundation, Inc.
 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
 #
@@ -17,7 +17,7 @@
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -43,8 +43,8 @@ EXIT_FAILURE=1
 
 PROGRAM=ltmain.sh
 PACKAGE=libtool
-VERSION=1.5.8
-TIMESTAMP=" (1.1220.2.118 2004/08/07 12:24:38)"
+VERSION=1.5.18
+TIMESTAMP=" (1.1220.2.245 2005/05/16 08:55:27)"
 
 # See if we are running on zsh, and set the options which allow our
 # commands through without removal of \ escapes.
@@ -112,8 +112,9 @@ if test "${LANG+set}" = set; then
 fi
 
 # Make sure IFS has a sensible default
-: ${IFS="      
-"}
+lt_nl='
+'
+IFS="  $lt_nl"
 
 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
   $echo "$modename: not configured to build any kind of library" 1>&2
@@ -132,6 +133,7 @@ show_help=
 execute_dlfiles=
 lo2o="s/\\.lo\$/.${objext}/"
 o2lo="s/\\.${objext}\$/.lo/"
+quote_scanset='[[~#^*{};<>?'"'"'       ]'
 
 #####################################
 # Shell function definitions:
@@ -143,7 +145,8 @@ o2lo="s/\\.${objext}\$/.lo/"
 # Need a lot of goo to handle *both* DLLs and import libs
 # Has to be a shell function in order to 'eat' the argument
 # that is supplied when $file_magic_command is called.
-func_win32_libid () {
+func_win32_libid ()
+{
   win32_libid_type="unknown"
   win32_fileres=`file -L $1 2>/dev/null`
   case $win32_fileres in
@@ -183,12 +186,13 @@ func_win32_libid () {
 # Only attempt this if the compiler in the base compile
 # command doesn't match the default compiler.
 # arg is usually of the form 'gcc ...'
-func_infer_tag () {
+func_infer_tag ()
+{
     if test -n "$available_tags" && test -z "$tagname"; then
       CC_quoted=
       for arg in $CC; do
        case $arg in
-         *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+         *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
          arg="\"$arg\""
          ;;
        esac
@@ -209,7 +213,7 @@ func_infer_tag () {
            for arg in $CC; do
            # Double-quote args containing other shell metacharacters.
            case $arg in
-             *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
+             *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
              arg="\"$arg\""
              ;;
            esac
@@ -242,8 +246,25 @@ func_infer_tag () {
 }
 
 
+# func_extract_an_archive dir oldlib
+func_extract_an_archive ()
+{
+    f_ex_an_ar_dir="$1"; shift
+    f_ex_an_ar_oldlib="$1"
+
+    $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
+    $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
+    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+     :
+    else
+      $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
+      exit $EXIT_FAILURE
+    fi
+}
+
 # func_extract_archives gentop oldlib ...
-func_extract_archives () {
+func_extract_archives ()
+{
     my_gentop="$1"; shift
     my_oldlibs=${1+"$@"}
     my_oldobjs=""
@@ -287,7 +308,7 @@ func_extract_archives () {
          cd $my_xdir || exit $?
          darwin_archive=$my_xabs
          darwin_curdir=`pwd`
-         darwin_base_archive=`basename $darwin_archive`
+         darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
          darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
          if test -n "$darwin_arches"; then 
            darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
@@ -296,64 +317,33 @@ func_extract_archives () {
            for darwin_arch in  $darwin_arches ; do
              mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
              lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
-             # Remove the table of contents from the thin files.
-             $AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF 2>/dev/null || true
-             $AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF\ SORTED 2>/dev/null || true
              cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
-             $AR -xo "${darwin_base_archive}"
-             rm "${darwin_base_archive}"
+             func_extract_an_archive "`pwd`" "${darwin_base_archive}"
              cd "$darwin_curdir"
+             $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
            done # $darwin_arches
       ## Okay now we have a bunch of thin objects, gotta fatten them up :)
-           darwin_filelist=`find unfat-$$ -type f | xargs basename | sort -u | $NL2SP`
+           darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
            darwin_file=
            darwin_files=
            for darwin_file in $darwin_filelist; do
              darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
              lipo -create -output "$darwin_file" $darwin_files
            done # $darwin_filelist
-           rm -rf unfat-$$
+           ${rm}r unfat-$$
            cd "$darwin_orig_dir"
          else
-           cd $darwin_orig_dir
-           (cd $my_xdir && $AR x $my_xabs) || exit $?
+           cd "$darwin_orig_dir"
+           func_extract_an_archive "$my_xdir" "$my_xabs"
          fi # $darwin_arches
        fi # $run
       ;;
       *)
-       # We will extract separately just the conflicting names and we will
-       # no longer touch any unique names. It is faster to leave these
-       # extract automatically by $AR in one run.
-       $show "(cd $my_xdir && $AR x $my_xabs)"
-       $run eval "(cd \$my_xdir && $AR x \$my_xabs)" || exit $?
-       if ($AR t "$my_xabs" | sort | sort -uc >/dev/null 2>&1); then
-         :
-       else
-         $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
-         $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
-         $AR t "$my_xabs" | sort | uniq -cd | while read -r count name
-         do
-           i=1
-           while test "$i" -le "$count"
-           do
-             # Put our $i before any first dot (extension)
-             # Never overwrite any file
-             name_to="$name"
-             while test "X$name_to" = "X$name" || test -f "$my_xdir/$name_to"
-             do
-               name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
-             done
-             $show "(cd $my_xdir && $AR xN $i $my_xabs '$name' && $mv '$name' '$name_to')"
-             $run eval "(cd \$my_xdir && $AR xN $i \$my_xabs '$name' && $mv '$name' '$name_to')" || exit $?
-             i=`expr $i + 1`
-           done
-         done
-       fi
-       ;;
+        func_extract_an_archive "$my_xdir" "$my_xabs"
+        ;;
       esac
       my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
     done
-
     func_extract_archives_result="$my_oldobjs"
 }
 # End of Shell function definitions
@@ -426,10 +416,10 @@ do
   --version)
     $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
     $echo
-    $echo "Copyright (C) 2003  Free Software Foundation, Inc."
+    $echo "Copyright (C) 2005  Free Software Foundation, Inc."
     $echo "This is free software; see the source for copying conditions.  There is NO"
     $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-    exit $EXIT_SUCCESS
+    exit $?
     ;;
 
   --config)
@@ -438,7 +428,7 @@ do
     for tagname in $taglist; do
       ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
     done
-    exit $EXIT_SUCCESS
+    exit $?
     ;;
 
   --debug)
@@ -463,7 +453,7 @@ do
     else
       $echo "disable static libraries"
     fi
-    exit $EXIT_SUCCESS
+    exit $?
     ;;
 
   --finish) mode="finish" ;;
@@ -520,7 +510,7 @@ if test -z "$show_help"; then
   # Infer the operation mode.
   if test -z "$mode"; then
     $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
-    $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
+    $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
     case $nonopt in
     *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
       mode=link
@@ -637,7 +627,7 @@ if test -z "$show_help"; then
            # Many Bourne shells cannot handle close brackets correctly
            # in scan sets, so we specify it separately.
            case $arg in
-             *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
+             *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
              arg="\"$arg\""
              ;;
            esac
@@ -668,8 +658,11 @@ if test -z "$show_help"; then
       case $lastarg in
       # Double-quote args containing other shell metacharacters.
       # Many Bourne shells cannot handle close brackets correctly
-      # in scan sets, so we specify it separately.
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*|"")
+      # in scan sets, and some SunOS ksh mistreat backslash-escaping
+      # in scan sets (worked around with variable expansion),
+      # and furthermore cannot handle '|' '&' '(' ')' in scan sets 
+      # at all, so we specify them separately.
+      *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
        lastarg="\"$lastarg\""
        ;;
       esac
@@ -742,6 +735,15 @@ if test -z "$show_help"; then
       esac
     done
 
+    qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
+    case $qlibobj in
+      *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
+       qlibobj="\"$qlibobj\"" ;;
+    esac
+    if test "X$libobj" != "X$qlibobj"; then
+       $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
+       exit $EXIT_FAILURE
+    fi
     objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
     xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
     if test "X$xdir" = "X$obj"; then
@@ -814,12 +816,17 @@ compiler."
        $run $rm $removelist
        exit $EXIT_FAILURE
       fi
-      $echo $srcfile > "$lockfile"
+      $echo "$srcfile" > "$lockfile"
     fi
 
     if test -n "$fix_srcfile_path"; then
       eval srcfile=\"$fix_srcfile_path\"
     fi
+    qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
+    case $qsrcfile in
+      *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
+      qsrcfile="\"$qsrcfile\"" ;;
+    esac
 
     $run $rm "$libobj" "${libobj}T"
 
@@ -841,10 +848,10 @@ EOF
       fbsd_hideous_sh_bug=$base_compile
 
       if test "$pic_mode" != no; then
-       command="$base_compile $srcfile $pic_flag"
+       command="$base_compile $qsrcfile $pic_flag"
       else
        # Don't build PIC code
-       command="$base_compile $srcfile"
+       command="$base_compile $qsrcfile"
       fi
 
       if test ! -d "${xdir}$objdir"; then
@@ -924,9 +931,9 @@ EOF
     if test "$build_old_libs" = yes; then
       if test "$pic_mode" != yes; then
        # Don't build PIC code
-       command="$base_compile $srcfile"
+       command="$base_compile $qsrcfile"
       else
-       command="$base_compile $srcfile $pic_flag"
+       command="$base_compile $qsrcfile $pic_flag"
       fi
       if test "$compiler_c_o" = yes; then
        command="$command -o $obj"
@@ -1104,7 +1111,7 @@ EOF
       arg="$1"
       shift
       case $arg in
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*|"")
+      *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
        qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
        ;;
       *) qarg=$arg ;;
@@ -1348,6 +1355,13 @@ EOF
          prev=
          continue
          ;;
+        darwin_framework)
+         compiler_flags="$compiler_flags $arg"
+         compile_command="$compile_command $arg"
+         finalize_command="$finalize_command $arg"
+         prev=
+         continue
+         ;;
        *)
          eval "$prev=\"\$arg\""
          prev=
@@ -1406,6 +1420,14 @@ EOF
        continue
        ;;
 
+      -framework)
+        prev=darwin_framework
+        compiler_flags="$compiler_flags $arg"
+       compile_command="$compile_command $arg"
+       finalize_command="$finalize_command $arg"
+        continue
+        ;;
+
       -inst-prefix-dir)
        prev=inst_prefix
        continue
@@ -1466,7 +1488,7 @@ EOF
            # These systems don't actually have a C library (as such)
            test "X$arg" = "X-lc" && continue
            ;;
-         *-*-openbsd* | *-*-freebsd*)
+         *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
            # Do not include libc due to us having libc/libc_r.
            test "X$arg" = "X-lc" && continue
            ;;
@@ -1477,7 +1499,7 @@ EOF
          esac
        elif test "X$arg" = "X-lc_r"; then
         case $host in
-        *-*-openbsd* | *-*-freebsd*)
+        *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
           # Do not include libc_r directly, use -pthread flag.
           continue
           ;;
@@ -1487,8 +1509,20 @@ EOF
        continue
        ;;
 
+      # Tru64 UNIX uses -model [arg] to determine the layout of C++
+      # classes, name mangling, and exception handling.
+      -model)
+       compile_command="$compile_command $arg"
+       compiler_flags="$compiler_flags $arg"
+       finalize_command="$finalize_command $arg"
+       prev=xcompiler
+       continue
+       ;;
+
      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
-       deplibs="$deplibs $arg"
+       compiler_flags="$compiler_flags $arg"
+       compile_command="$compile_command $arg"
+       finalize_command="$finalize_command $arg"
        continue
        ;;
 
@@ -1497,18 +1531,19 @@ EOF
        continue
        ;;
 
-      # gcc -m* arguments should be passed to the linker via $compiler_flags
-      # in order to pass architecture information to the linker
-      # (e.g. 32 vs 64-bit).  This may also be accomplished via -Wl,-mfoo
-      # but this is not reliable with gcc because gcc may use -mfoo to
-      # select a different linker, different libraries, etc, while
-      # -Wl,-mfoo simply passes -mfoo to the linker.
-      -m*)
+      # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
+      # -r[0-9][0-9]* specifies the processor on the SGI compiler
+      # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
+      # +DA*, +DD* enable 64-bit mode on the HP compiler
+      # -q* pass through compiler args for the IBM compiler
+      # -m* pass through architecture-specific compiler args for GCC
+      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*)
+
        # Unknown arguments in both finalize_command and compile_command need
        # to be aesthetically quoted because they are evaled later.
        arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
        case $arg in
-       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*|"")
+       *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
          arg="\"$arg\""
          ;;
        esac
@@ -1624,7 +1659,7 @@ EOF
        for flag in $args; do
          IFS="$save_ifs"
          case $flag in
-           *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*|"")
+           *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
            flag="\"$flag\""
            ;;
          esac
@@ -1642,7 +1677,7 @@ EOF
        for flag in $args; do
          IFS="$save_ifs"
          case $flag in
-           *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*|"")
+           *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
            flag="\"$flag\""
            ;;
          esac
@@ -1675,7 +1710,7 @@ EOF
        # to be aesthetically quoted because they are evaled later.
        arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
        case $arg in
-       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*|"")
+       *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
          arg="\"$arg\""
          ;;
        esac
@@ -1809,7 +1844,7 @@ EOF
        # to be aesthetically quoted because they are evaled later.
        arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
        case $arg in
-       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*|"")
+       *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
          arg="\"$arg\""
          ;;
        esac
@@ -1976,7 +2011,7 @@ EOF
            compile_deplibs="$deplib $compile_deplibs"
            finalize_deplibs="$deplib $finalize_deplibs"
          else
-           deplibs="$deplib $deplibs"
+           compiler_flags="$compiler_flags $deplib"
          fi
          continue
          ;;
@@ -1985,10 +2020,6 @@ EOF
            $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
            continue
          fi
-         if test "$pass" = conv; then
-           deplibs="$deplib $deplibs"
-           continue
-         fi
          name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
          for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
            for search_ext in .la $std_shrext .so .a; do
@@ -2188,6 +2219,8 @@ EOF
        # it will not redefine variables installed, or shouldnotlink
        installed=yes
        shouldnotlink=no
+       avoidtemprpath=
+
 
        # Read the .la file
        case $lib in
@@ -2286,6 +2319,7 @@ EOF
            dir="$libdir"
            absdir="$libdir"
          fi
+         test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
        else
          if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
            dir="$ladir"
@@ -2370,7 +2404,7 @@ EOF
          if test -n "$library_names" &&
             { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
            # We need to hardcode the library path
-           if test -n "$shlibpath_var"; then
+           if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
              # Make sure the rpath contains only unique directories.
              case "$temp_rpath " in
              *" $dir "*) ;;
@@ -2814,12 +2848,12 @@ EOF
              *) continue ;;
              esac
              case " $deplibs " in
-             *" $depdepl "*) ;;
-             *) deplibs="$depdepl $deplibs" ;;
+             *" $path "*) ;;
+             *) deplibs="$path $deplibs" ;;
              esac
              case " $deplibs " in
-             *" $path "*) ;;
-             *) deplibs="$deplibs $path" ;;
+             *" $depdepl "*) ;;
+             *) deplibs="$depdepl $deplibs" ;;
              esac
            done
          fi # link_all_deplibs != no
@@ -3084,27 +3118,27 @@ EOF
 
        # Check that each of the things are valid numbers.
        case $current in
-       0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
+       0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
        *)
-         $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
+         $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
          exit $EXIT_FAILURE
          ;;
        esac
 
        case $revision in
-       0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
+       0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
        *)
-         $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
+         $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
          exit $EXIT_FAILURE
          ;;
        esac
 
        case $age in
-       0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
+       0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
        *)
-         $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
+         $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
          exit $EXIT_FAILURE
          ;;
@@ -3336,7 +3370,7 @@ EOF
          *-*-netbsd*)
            # Don't link with libc until the a.out ld.so is fixed.
            ;;
-         *-*-openbsd* | *-*-freebsd*)
+         *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
            # Do not include libc due to us having libc/libc_r.
            test "X$arg" = "X-lc" && continue
            ;;
@@ -3873,6 +3907,7 @@ EOF
            save_libobjs=$libobjs
          fi
          save_output=$output
+         output_la=`$echo "X$output" | $Xsed -e "$basename"`
 
          # Clear the reloadable object creation command queue and
          # initialize k to one.
@@ -3882,7 +3917,7 @@ EOF
          delfiles=
          last_robj=
          k=1
-         output=$output_objdir/$save_output-${k}.$objext
+         output=$output_objdir/$output_la-${k}.$objext
          # Loop over the list of objects to be linked.
          for obj in $save_libobjs
          do
@@ -3902,9 +3937,9 @@ EOF
                # the last one created.
                eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
              fi
-             last_robj=$output_objdir/$save_output-${k}.$objext
+             last_robj=$output_objdir/$output_la-${k}.$objext
              k=`expr $k + 1`
-             output=$output_objdir/$save_output-${k}.$objext
+             output=$output_objdir/$output_la-${k}.$objext
              objlist=$obj
              len=1
            fi
@@ -3924,13 +3959,13 @@ EOF
            eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
           fi
 
-         # Set up a command to remove the reloadale object files
+         # Set up a command to remove the reloadable object files
          # after they are used.
          i=0
          while test "$i" -lt "$k"
          do
            i=`expr $i + 1`
-           delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
+           delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
          done
 
          $echo "creating a temporary reloadable object file: $output"
@@ -4327,12 +4362,12 @@ extern \"C\" {
 
            # Prepare the list of exported symbols
            if test -z "$export_symbols"; then
-             export_symbols="$output_objdir/$output.exp"
+             export_symbols="$output_objdir/$outputname.exp"
              $run $rm $export_symbols
              $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
            else
-             $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
-             $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
+             $run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+             $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
              $run eval 'mv "$nlist"T "$nlist"'
            fi
          fi
@@ -4384,7 +4419,26 @@ extern \"C\" {
 #endif
 
 /* The mapping between symbol names and symbols. */
+"
+
+           case $host in
+           *cygwin* | *mingw* )
+         $echo >> "$output_objdir/$dlsyms" "\
+/* DATA imports from DLLs on WIN32 can't be const, because
+   runtime relocations are performed -- see ld's documentation
+   on pseudo-relocs */
+struct {
+"
+             ;;
+           * )
+         $echo >> "$output_objdir/$dlsyms" "\
 const struct {
+"
+             ;;
+           esac
+
+
+         $echo >> "$output_objdir/$dlsyms" "\
   const char *name;
   lt_ptr address;
 }
@@ -4613,7 +4667,7 @@ static const void *lt_preloaded_setup() {
        esac
        case $host in
          *cygwin* | *mingw* )
-           cwrappersource=`$echo ${objdir}/lt-${output}.c`
+           cwrappersource=`$echo ${objdir}/lt-${outputname}.c`
            cwrapper=`$echo ${output}.exe`
            $rm $cwrappersource $cwrapper
            trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
@@ -5033,6 +5087,63 @@ fi\
       if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
        cmds=$old_archive_from_new_cmds
       else
+       # POSIX demands no paths to be encoded in archives.  We have
+       # to avoid creating archives with duplicate basenames if we
+       # might have to extract them afterwards, e.g., when creating a
+       # static archive out of a convenience library, or when linking
+       # the entirety of a libtool archive into another (currently
+       # not supported by libtool).
+       if (for obj in $oldobjs
+           do
+             $echo "X$obj" | $Xsed -e 's%^.*/%%'
+           done | sort | sort -uc >/dev/null 2>&1); then
+         :
+       else
+         $echo "copying selected object files to avoid basename conflicts..."
+
+         if test -z "$gentop"; then
+           gentop="$output_objdir/${outputname}x"
+           generated="$generated $gentop"
+
+           $show "${rm}r $gentop"
+           $run ${rm}r "$gentop"
+           $show "$mkdir $gentop"
+           $run $mkdir "$gentop"
+           status=$?
+           if test "$status" -ne 0 && test ! -d "$gentop"; then
+             exit $status
+           fi
+         fi
+
+         save_oldobjs=$oldobjs
+         oldobjs=
+         counter=1
+         for obj in $save_oldobjs
+         do
+           objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
+           case " $oldobjs " in
+           " ") oldobjs=$obj ;;
+           *[\ /]"$objbase "*)
+             while :; do
+               # Make sure we don't pick an alternate name that also
+               # overlaps.
+               newobj=lt$counter-$objbase
+               counter=`expr $counter + 1`
+               case " $oldobjs " in
+               *[\ /]"$newobj "*) ;;
+               *) if test ! -f "$gentop/$newobj"; then break; fi ;;
+               esac
+             done
+             $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+             $run ln "$obj" "$gentop/$newobj" ||
+             $run cp "$obj" "$gentop/$newobj"
+             oldobjs="$oldobjs $gentop/$newobj"
+             ;;
+           *) oldobjs="$oldobjs $obj" ;;
+           esac
+         done
+       fi
+
        eval cmds=\"$old_archive_cmds\"
 
        if len=`expr "X$cmds" : ".*"` &&
@@ -5046,20 +5157,7 @@ fi\
          objlist=
          concat_cmds=
          save_oldobjs=$oldobjs
-         # GNU ar 2.10+ was changed to match POSIX; thus no paths are
-         # encoded into archives.  This makes 'ar r' malfunction in
-         # this piecewise linking case whenever conflicting object
-         # names appear in distinct ar calls; check, warn and compensate.
-           if (for obj in $save_oldobjs
-           do
-             $echo "X$obj" | $Xsed -e 's%^.*/%%'
-           done | sort | sort -uc >/dev/null 2>&1); then
-           :
-         else
-           $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
-           $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
-           AR_FLAGS=cq
-         fi
+
          # Is there a better way of finding the last object in the list?
          for obj in $save_oldobjs
          do
@@ -5271,7 +5369,7 @@ relink_command=\"$relink_command\""
       # Aesthetically quote it.
       arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
       case $arg in
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*)
+      *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
        arg="\"$arg\""
        ;;
       esac
@@ -5287,7 +5385,7 @@ relink_command=\"$relink_command\""
     # Aesthetically quote it.
     arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
     case $arg in
-    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \      ]*|*]*)
+    *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
       arg="\"$arg\""
       ;;
     esac
@@ -5335,7 +5433,7 @@ relink_command=\"$relink_command\""
       # Aesthetically quote the argument.
       arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
       case $arg in
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*)
+      *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
        arg="\"$arg\""
        ;;
       esac
@@ -5968,14 +6066,14 @@ relink_command=\"$relink_command\""
       fi
 
       # Now prepare to actually exec the command.
-      exec_cmd="\"\$cmd\"$args"
+      exec_cmd="\$cmd$args"
     else
       # Display what would be done.
       if test -n "$shlibpath_var"; then
        eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
        $echo "export $shlibpath_var"
       fi
-      eval \$echo \"\$cmd\"$args
+      $echo "$cmd$args"
       exit $EXIT_SUCCESS
     fi
     ;;
@@ -6374,7 +6472,7 @@ esac
 $echo
 $echo "Try \`$modename --help' for more information about other modes."
 
-exit $EXIT_SUCCESS
+exit $?
 
 # The TAGs below are defined such that we never get into a situation
 # in which we disable both kinds of libraries.  Given conflicting
index 4825390a6fd27aba2457fe1c5aeeadd63485b7f4..1d12cdc42e78387a1bbe3dddb26d9f1cd54c3329 100644 (file)
 #define _zzip_restrict restrict\r
 #endif\r
 #endif\r
-#ifdef __linux__\r
-#define _zzip_new _zzip_restrict\r
+#if defined __linux__ && __GNUC__+0 >= 4\r
+#define zzip__new__ __attribute__((malloc))\r
+#elif defined __linux__ && __GNUC__+0 >= 3 && __GNUC_MINOR_+0 >= 3\r
+#define zzip__new__  __attribute__((malloc))\r
 #else\r
-#define _zzip_new\r
+#define zzip__new__\r
 #endif\r
 \r
 #ifndef _zzip_size_t\r
index bb719ba911a38b668ecc3f1203205b6c60712fe6..0e6c4b395c310470b3c0441b2a4c10f095c75e02 100644 (file)
 #endif
 
 /* get 16/32 bits from little-endian zip-file to host byteorder */
-extern uint32_t __zzip_get32(unsigned char * s) __attribute__((const));
-extern uint16_t __zzip_get16(unsigned char * s) __attribute__((const));
-extern void     __zzip_set32(unsigned char * s, uint32_t v);
-extern void     __zzip_set16(unsigned char * s, uint16_t v);
+extern uint32_t __zzip_get32(zzip_byte_t * s) __attribute__((const));
+extern uint16_t __zzip_get16(zzip_byte_t * s) __attribute__((const));
+extern void     __zzip_set32(zzip_byte_t * s, uint32_t v);
+extern void     __zzip_set16(zzip_byte_t * s, uint16_t v);
 
-extern zzip_off64_t __zzip_get64(unsigned char * s) __attribute__((const));
-extern void         __zzip_set64(unsigned char * s, zzip_off64_t v);
+extern zzip_off64_t __zzip_get64(zzip_byte_t * s) __attribute__((const));
+extern void         __zzip_set64(zzip_byte_t * s, zzip_off64_t v);
 
 #ifdef ZZIP_WORDS_BIGENDIAN
 # if defined bswap_16 && defined bswap_32 && defined bswap_64 /* i.e. linux */
@@ -131,10 +131,10 @@ extern void         __zzip_set64(unsigned char * s, zzip_off64_t v);
 #define zzip_disk_trailer_check_magic(__p)  ZZIP_DISK_TRAILER_CHECKMAGIC((__p))
 
 /* extra field should be type + size + data + type + size + data ... */
-#define zzip_extra_block_get_datatype(__p)     ZZIP_GET16((char*)(__p))
-#define zzip_extra_block_set_datatype(__p,__x) ZZIP_SET16((char*)(__p),__x)
-#define zzip_extra_block_get_datasize(__p)     ZZIP_GET16((char*)(__p)+2)
-#define zzip_extra_block_set_datasize(__p,__x) ZZIP_SET16((char*)(__p)+2,__x)
+#define zzip_extra_block_get_datatype(__p)     ZZIP_GET16((zzip_byte_t*)(__p))
+#define zzip_extra_block_set_datatype(__p,__x) ZZIP_SET16((zzip_byte_t*)(__p),__x)
+#define zzip_extra_block_get_datasize(__p)     ZZIP_GET16((zzip_byte_t*)(__p)+2)
+#define zzip_extra_block_set_datasize(__p,__x) ZZIP_SET16((zzip_byte_t*)(__p)+2,__x)
 
 /* zzip64_disk_trailer - the zip64 archive entry point */
 #define zzip_disk64_trailer_get_magic(__p)      ZZIP_GET32((__p)->z_magic)
@@ -170,14 +170,14 @@ extern void         __zzip_set64(unsigned char * s, zzip_off64_t v);
         zzip_file_header_sizeof_tails(__p))
 #define zzip_file_header_sizeto_end(__p)   ((zzip_size_t) \
         (zzip_file_header_sizeof_tail(__p) + zzip_file_header_headerlength))
-#define zzip_file_header_skipto_end(__p)   ((char*) (__p) + \
+#define zzip_file_header_skipto_end(__p)   ((void*) (__p) + \
         (zzip_file_header_sizeof_tail(__p) + zzip_file_header_headerlength))
 
 #define zzip_file_header_to_filename(__p)   ((char*) \
         ((char*)(__p) + zzip_file_header_headerlength))
 #define zzip_file_header_to_extras(__p)   ((char*) \
         (zzip_file_header_to_filename(__p) + zzip_file_header_namlen(__p)))
-#define zzip_file_header_to_data(__p)   ((char*) \
+#define zzip_file_header_to_data(__p)   ((zzip_byte_t*) \
         (zzip_file_header_to_extras(__p) + zzip_file_header_extras(__p)))
 #define zzip_file_header_to_trailer(__p)   ((struct zzip_file_trailer*) \
         (zzip_file_header_to_data(__p) + zzip_file_header_csize(__p)))
@@ -191,7 +191,7 @@ extern void         __zzip_set64(unsigned char * s, zzip_off64_t v);
         zzip_file_trailer_sizeof_tails(__p))
 #define zzip_file_trailer_sizeto_end(__p)   ((zzip_size_t) \
         (zzip_file_trailer_sizeof_tail(__p) + zzip_file_trailer_headerlength))
-#define zzip_file_trailer_skipto_end(__p)   ((char*) (__p) + \
+#define zzip_file_trailer_skipto_end(__p)   ((void*) (__p) + \
         (zzip_file_trailer_sizeof_tail(__p) + zzip_file_trailer_headerlength))
 
 /* zzip_disk_entry (currently named zzip_root_dirent) */
@@ -217,7 +217,7 @@ extern void         __zzip_set64(unsigned char * s, zzip_off64_t v);
         zzip_disk_entry_sizeof_tails(__p))
 #define zzip_disk_entry_sizeto_end(__p)   ((zzip_size_t) \
         (zzip_disk_entry_sizeof_tail(__p) + zzip_disk_entry_headerlength))
-#define zzip_disk_entry_skipto_end(__p)   ((char*) (__p) + \
+#define zzip_disk_entry_skipto_end(__p)   ((zzip_byte_t*) (__p) + \
         (zzip_disk_entry_sizeof_tail(__p) + zzip_disk_entry_headerlength))
 
 #define zzip_disk_entry_to_filename(__p)   ((char*) \
@@ -248,12 +248,12 @@ extern void         __zzip_set64(unsigned char * s, zzip_off64_t v);
         zzip_disk_trailer_sizeof_tails(__p))
 #define zzip_disk_trailer_sizeto_end(__p)   ((zzip_size_t) \
         (zzip_disk_trailer_sizeof_tail(__p) + zzip_disk_trailer_headerlength))
-#define zzip_disk_trailer_skipto_end(__p)   ((char*) (__p) \
+#define zzip_disk_trailer_skipto_end(__p)   ((void*) (__p) \
         (zzip_disk_trailer_sizeof_tail(__p) + zzip_disk_trailer_headerlength))
 
 #define zzip_disk_trailer_to_comment(__p)   ((char*) \
         ((char*)(__p) + zzip_disk_trailer_headerlength))
-#define zzip_disk_trailer_to_endoffile(__p)   ((char*) \
+#define zzip_disk_trailer_to_endoffile(__p)   ((void*) \
         (zzip_disk_trailer_to_comment(__p) + zzip_disk_trailer_comment(__p)))
 
 /* zzip_disk64_trailer - the zip archive entry point */
@@ -273,7 +273,7 @@ extern void         __zzip_set64(unsigned char * s, zzip_off64_t v);
         zzip_disk64_trailer_get_size(__p) - zzip_disk64_trailer_headerlength)
 #define zzip_disk64_trailer_sizeto_end(__p)   ((zzip_size_t) \
         zzip_disk64_trailer_get_size(__p))
-#define zzip_disk64_trailer_skipto_end(__p)   ((char*) \
+#define zzip_disk64_trailer_skipto_end(__p)   ((void*) \
         ((char*)(__p) + zzip_disk64_sizeto_end(__p)))
 
 /* extra field should be type + size + data + type + size + data ... */
@@ -281,7 +281,7 @@ extern void         __zzip_set64(unsigned char * s, zzip_off64_t v);
         (zzip_extra_block_get_datasize(__p)))
 #define zzip_extra_block_sizeto_end(__p)    ((zzip_size_t) \
         (zzip_extra_block_sizeof_tail(__p) + zzip_extra_block_headerlength))
-#define zzip_extra_block_skipto_end(__p)    ((char*) (__p) \
+#define zzip_extra_block_skipto_end(__p)    ((void*) (__p) \
         (zzip_extra_block_sizeof_tail(__p) + zzip_extra_block_headerlength))
 
 /* ................... and put these to the next level ................ */
index 21857c3cd66ed6d82f45f29caae0179c7259a89f..fba4000aa76a3cfa11d4d3008f2a18d0f23ecdda 100644 (file)
 
 struct zzip_version 
 { 
-    char   version[1]; 
-    char   ostype[1]; 
+    zzip_byte_t   version[1]; 
+    zzip_byte_t   ostype[1]; 
 } __zzip_attribute__((packed));
 
 struct zzip_dostime 
 { 
-    char   time[2]; 
-    char   date[2]; 
+    zzip_byte_t   time[2]; 
+    zzip_byte_t   date[2]; 
 } __zzip_attribute__((packed)); 
 
 #ifdef ZZIP_NEED_PACKED
 /* if your compiler does interesting things about struct packing... */
-typedef char zzip_version_t[2];
-typedef char zzip_dostime_t[4];
+typedef zzip_byte_t zzip_version_t[2];
+typedef zzip_byte_t zzip_dostime_t[4];
 #else
 typedef struct zzip_version zzip_version_t;
 typedef struct zzip_dostime zzip_dostime_t;
 #endif
 
 #define ZZIP_CHECKMAGIC(__p,__A,__B,__C,__D) \
-    ( (((char*)(__p))[0]==(__A)) && \
-      (((char*)(__p))[1]==(__B)) && \
-      (((char*)(__p))[2]==(__C)) && \
-      (((char*)(__p))[3]==(__D)) )
+    ( (((zzip_byte_t*)(__p))[0]==(__A)) && \
+      (((zzip_byte_t*)(__p))[1]==(__B)) && \
+      (((zzip_byte_t*)(__p))[2]==(__C)) && \
+      (((zzip_byte_t*)(__p))[3]==(__D)) )
 
 /* A. Local file header */
 struct zzip_file_header
 {
 #   define ZZIP_FILE_HEADER_MAGIC 0x04034b50
 #   define ZZIP_FILE_HEADER_CHECKMAGIC(__p) ZZIP_CHECKMAGIC(__p,'P','K','\3','\4')
-    char   z_magic[4]; /* local file header signature (0x04034b50) */
+    zzip_byte_t   z_magic[4]; /* local file header signature (0x04034b50) */
     zzip_version_t z_extract; /* version needed to extract */
-    char   z_flags[2]; /* general purpose bit flag */
-    char   z_compr[2]; /* compression method */
+    zzip_byte_t   z_flags[2]; /* general purpose bit flag */
+    zzip_byte_t   z_compr[2]; /* compression method */
     zzip_dostime_t z_dostime; /* last mod file time (dos format) */
-    char   z_crc32[4]; /* crc-32 */
-    char   z_csize[4]; /* compressed size */
-    char   z_usize[4]; /* uncompressed size */
-    char   z_namlen[2]; /* filename length (null if stdin) */
-    char   z_extras[2]; /* extra field length */
+    zzip_byte_t   z_crc32[4]; /* crc-32 */
+    zzip_byte_t   z_csize[4]; /* compressed size */
+    zzip_byte_t   z_usize[4]; /* uncompressed size */
+    zzip_byte_t   z_namlen[2]; /* filename length (null if stdin) */
+    zzip_byte_t   z_extras[2]; /* extra field length */
     /* followed by filename (of variable size) */
     /* followed by extra field (of variable size) */
 } __zzip_attribute__((packed));
@@ -86,10 +86,10 @@ struct zzip_file_trailer
 {
 #   define ZZIP_FILE_TRAILER_MAGIC 0x08074B50
 #   define ZZIP_FILE_TRAILER_CHECKMAGIC(__p) ZZIP_CHECKMAGIC(__p,'P','K','\7','\8')
-    char   z_magic[4]; /* data descriptor signature (0x08074b50) */
-    char   z_crc32[4]; /* crc-32 */
-    char   z_csize[4]; /* compressed size */
-    char   z_usize[4]; /* uncompressed size */
+    zzip_byte_t   z_magic[4]; /* data descriptor signature (0x08074b50) */
+    zzip_byte_t   z_crc32[4]; /* crc-32 */
+    zzip_byte_t   z_csize[4]; /* compressed size */
+    zzip_byte_t   z_usize[4]; /* uncompressed size */
 } __zzip_attribute__((packed));
 #define zzip_file_trailer_headerlength (4+4+4+4)
 
@@ -105,22 +105,22 @@ struct zzip_disk_entry
 {
 #   define ZZIP_DISK_ENTRY_MAGIC 0x02014b50
 #   define ZZIP_DISK_ENTRY_CHECKMAGIC(__p) ZZIP_CHECKMAGIC(__p,'P','K','\1','\2')
-    char  z_magic[4];  /* central file header signature (0x02014b50) */
+    zzip_byte_t  z_magic[4];  /* central file header signature (0x02014b50) */
     zzip_version_t z_encoder;  /* version made by */
     zzip_version_t z_extract;  /* version need to extract */
-    char  z_flags[2];  /* general purpose bit flag */
-    char  z_compr[2];  /* compression method */
+    zzip_byte_t  z_flags[2];  /* general purpose bit flag */
+    zzip_byte_t  z_compr[2];  /* compression method */
     zzip_dostime_t z_dostime;  /* last mod file time&date (dos format) */
-    char  z_crc32[4];  /* crc-32 */
-    char  z_csize[4];  /* compressed size */
-    char  z_usize[4];  /* uncompressed size */
-    char  z_namlen[2]; /* filename length (null if stdin) */
-    char  z_extras[2];  /* extra field length */
-    char  z_comment[2]; /* file comment length */
-    char  z_diskstart[2]; /* disk number of start (if spanning zip over multiple disks) */
-    char  z_filetype[2];  /* internal file attributes, bit0 = ascii */
-    char  z_filemode[4];  /* extrnal file attributes, eg. msdos attrib byte */
-    char  z_offset[4];    /* relative offset of local file header, seekval if singledisk */
+    zzip_byte_t  z_crc32[4];  /* crc-32 */
+    zzip_byte_t  z_csize[4];  /* compressed size */
+    zzip_byte_t  z_usize[4];  /* uncompressed size */
+    zzip_byte_t  z_namlen[2]; /* filename length (null if stdin) */
+    zzip_byte_t  z_extras[2];  /* extra field length */
+    zzip_byte_t  z_comment[2]; /* file comment length */
+    zzip_byte_t  z_diskstart[2]; /* disk number of start (if spanning zip over multiple disks) */
+    zzip_byte_t  z_filetype[2];  /* internal file attributes, bit0 = ascii */
+    zzip_byte_t  z_filemode[4];  /* extrnal file attributes, eg. msdos attrib byte */
+    zzip_byte_t  z_offset[4];    /* relative offset of local file header, seekval if singledisk */
     /* followed by filename (of variable size) */
     /* followed by extra field (of variable size) */
     /* followed by file comment (of variable size) */
@@ -132,13 +132,22 @@ struct zzip_root_dirent
 {   /* the old name of the structure above */
 #   define ZZIP_ROOT_DIRENT_MAGIC 0x02014b50
 #   define ZZIP_ROOT_DIRENT_CHECKMAGIC(__p) ZZIP_DISK_ENTRY_CHECKMAGIC(__p)
-    char  z_magic[4];
-    zzip_version_t z_encoder;                     zzip_version_t z_extract;
-    char  z_flags[2];      char  z_compr[2];      zzip_dostime_t z_dostime;
-    char  z_crc32[4];      char  z_csize[4];      char  z_usize[4];
-    char  z_namlen[2];     char  z_extras[2];     char  z_comment[2];    
-    char  z_diskstart[2];  char  z_filetype[2];   char  z_filemode[4];
-    char  z_off[4];
+    zzip_byte_t    z_magic[4];
+    zzip_version_t z_encoder;                     
+    zzip_version_t z_extract;
+    zzip_byte_t    z_flags[2];      
+    zzip_byte_t    z_compr[2];      
+    zzip_dostime_t z_dostime;
+    zzip_byte_t    z_crc32[4];      
+    zzip_byte_t    z_csize[4];      
+    zzip_byte_t    z_usize[4];
+    zzip_byte_t    z_namlen[2];     
+    zzip_byte_t    z_extras[2];     
+    zzip_byte_t    z_comment[2];    
+    zzip_byte_t    z_diskstart[2];  
+    zzip_byte_t    z_filetype[2];   
+    zzip_byte_t    z_filemode[4];
+    zzip_byte_t    z_off[4];
 } __zzip_attribute__((packed)); 
 
 
@@ -147,15 +156,15 @@ struct zzip_disk_trailer
 {
 #   define ZZIP_DISK_TRAILER_MAGIC 0x06054b50
 #   define ZZIP_DISK_TRAILER_CHECKMAGIC(__p) ZZIP_CHECKMAGIC(__p,'P','K','\5','\6')
-    char  z_magic[4]; /* end of central dir signature (0x06054b50) */
-    char  z_disk[2];  /* number of this disk */
-    char  z_finaldisk[2]; /* number of the disk with the start of the central dir */
-    char  z_entries[2]; /* total number of entries in the central dir on this disk */
-    char  z_finalentries[2]; /* total number of entries in the central dir */
-    char  z_rootsize[4]; /* size of the central directory */
-    char  z_rootseek[4]; /* offset of start of central directory with respect to *
+    zzip_byte_t  z_magic[4]; /* end of central dir signature (0x06054b50) */
+    zzip_byte_t  z_disk[2];  /* number of this disk */
+    zzip_byte_t  z_finaldisk[2]; /* number of the disk with the start of the central dir */
+    zzip_byte_t  z_entries[2]; /* total number of entries in the central dir on this disk */
+    zzip_byte_t  z_finalentries[2]; /* total number of entries in the central dir */
+    zzip_byte_t  z_rootsize[4]; /* size of the central directory */
+    zzip_byte_t  z_rootseek[4]; /* offset of start of central directory with respect to *
                           * the starting disk number */
-    char  z_comment[2];  /* zipfile comment length */
+    zzip_byte_t  z_comment[2];  /* zipfile comment length */
     /* followed by zipfile comment (of variable size) */
 } __zzip_attribute__((packed));
 #define zzip_disk_trailer_headerlength (4+2+2+2+2+4+4+2)
@@ -163,8 +172,8 @@ struct zzip_disk_trailer
 /* extra field should be type + size + data + type + size + data ... */
 struct zzip_extra_block
 {                              /* fetch.h macros do not need this struct */
-    char  z_datatype[2];       /* as input type - a mere <char*> is okay */
-    char  z_datasize[2];       /* being returned by xx_to_extras usually */
+    zzip_byte_t  z_datatype[2];       /* as input type - a mere <char*> is okay */
+    zzip_byte_t  z_datasize[2];       /* being returned by xx_to_extras usually */
 } __zzip_attribute__((packed));
 #define zzip_extra_block_headerlength (2+2)
 
@@ -173,26 +182,26 @@ struct zzip_disk64_trailer
 {
 #   define ZZIP_DISK64_TRAILER_MAGIC 0x06064b50
 #   define ZZIP_DISK64_TRAILER_CHECKMAGIC(__p) ZZIP_CHECKMAGIC(__p,'P','K','\6','\6')
-    char  z_magic[4]; /* end of central dir signature (0x06054b50) */
-    char  z_size[8];  /* size of this central directory record */
+    zzip_byte_t  z_magic[4]; /* end of central dir signature (0x06054b50) */
+    zzip_byte_t  z_size[8];  /* size of this central directory record */
     zzip_version_t z_encoder;  /* version made by */
     zzip_version_t z_extract;  /* version need to extract */
-    char  z_disk[4];  /* number of this disk */
-    char  z_finaldisk[4]; /* number of the disk with the start of the central dir */
-    char  z_entries[8]; /* total number of entries in the central dir on this disk */
-    char  z_finalentries[8]; /* total number of entries in the central dir */
-    char  z_rootsize[8]; /* size of the central directory */
-    char  z_rootseek[8]; /* offset of start of central directory with respect to *
+    zzip_byte_t  z_disk[4];  /* number of this disk */
+    zzip_byte_t  z_finaldisk[4]; /* number of the disk with the start of the central dir */
+    zzip_byte_t  z_entries[8]; /* total number of entries in the central dir on this disk */
+    zzip_byte_t  z_finalentries[8]; /* total number of entries in the central dir */
+    zzip_byte_t  z_rootsize[8]; /* size of the central directory */
+    zzip_byte_t  z_rootseek[8]; /* offset of start of central directory with respect to *
                           * the starting disk number */
     /* followed by zip64 extensible data sector (of variable size) */
 } __zzip_attribute__((packed));
 #define zzip_disk64_trailer_headerlength (4+8+2+2+4+4+8+8+8+8)
 
 /* z_flags */
-#define ZZIP_IS_ENCRYPTED(p)    ((*(unsigned char*)p)&1)
-#define ZZIP_IS_COMPRLEVEL(p)  (((*(unsigned char*)p)>>1)&3)
-#define ZZIP_IS_STREAMED(p)    (((*(unsigned char*)p)>>3)&1)
-#define ZZIP_IS_PATCHED(p)     (((*(unsigned char*)p)>>5)&1)
+#define ZZIP_IS_ENCRYPTED(p)    ((*(zzip_byte_t*)p)&1)
+#define ZZIP_IS_COMPRLEVEL(p)  (((*(zzip_byte_t*)p)>>1)&3)
+#define ZZIP_IS_STREAMED(p)    (((*(zzip_byte_t*)p)>>3)&1)
+#define ZZIP_IS_PATCHED(p)     (((*(zzip_byte_t*)p)>>5)&1)
 
 /* z_compr */
 #define ZZIP_IS_STORED          0
index 91c935f1b790e1b69a1571f673d6b2f0328c5a25..2207f5dc981cd1e3c6dbe8964bca56a1eeac1dd6 100644 (file)
@@ -131,7 +131,7 @@ zzip_entry_data_offset(ZZIP_ENTRY* entry)
  * in the zip central directory but if not then we fallback to the filename
  * given in the file_header of each compressed data portion.
  */
-char* _zzip_new
+zzip__new__ char*
 zzip_entry_strdup_name(ZZIP_ENTRY* entry)
 {
     if (! entry) return 0;
@@ -210,7 +210,7 @@ prescan_clear(ZZIP_ENTRY* entry)
  * catch a common brokeness with zip archives that still allows us to find
  * the start of the zip central directory.
  */
-ZZIP_ENTRY* _zzip_new
+zzip__new__ ZZIP_ENTRY*
 zzip_entry_findfirst(FILE* disk)
 {
     if (! disk) return 0;
@@ -220,7 +220,7 @@ zzip_entry_findfirst(FILE* disk)
     /* we read out chunks of 8 KiB in the hope to match disk granularity */
     ___ zzip_off_t pagesize = PAGESIZE; /* getpagesize() */
     ___ ZZIP_ENTRY* entry = malloc (sizeof(*entry));  if (! entry) return 0;
-    ___ char* buffer = malloc (pagesize);             if (! buffer) goto nomem;
+    ___ unsigned char* buffer = malloc (pagesize);    if (! buffer) goto nomem;
 
     assert (pagesize/2 > (zzip_off_t) sizeof (struct zzip_disk_trailer));
     /* at each step, we will fread a pagesize block which overlaps with the
@@ -232,7 +232,8 @@ zzip_entry_findfirst(FILE* disk)
     while(1) {
        fseeko (disk, mapoffs, SEEK_SET);
        fread (buffer, 1, mapsize, disk);
-       ___ char* p = buffer + mapsize - sizeof(struct zzip_disk_trailer);
+       ___ unsigned char* p = 
+           buffer + mapsize - sizeof(struct zzip_disk_trailer);
        for (; p >= buffer ; p--)
        {
            zzip_off_t root;  /* (struct zzip_disk_entry*) */
@@ -286,7 +287,7 @@ zzip_entry_findfirst(FILE* disk)
  * to stop searching for matches before that case then please call 
  * => zzip_entry_free on the cursor struct ZZIP_ENTRY.
  */
-ZZIP_ENTRY* _zzip_new
+zzip__new__ ZZIP_ENTRY*
 zzip_entry_findnext(ZZIP_ENTRY* _zzip_restrict entry)
 {
     if (! entry) return entry;
@@ -331,7 +332,7 @@ zzip_entry_free(ZZIP_ENTRY* entry)
  * is rather useless with this variant of _findfile). If no further entry is
  * found then null is returned and any "old"-entry gets already free()d.
  */
-ZZIP_ENTRY* _zzip_new
+zzip__new__ ZZIP_ENTRY*
 zzip_entry_findfile(FILE* disk, char* filename, 
                    ZZIP_ENTRY* _zzip_restrict entry, 
                    zzip_strcmp_fn_t compare)
@@ -385,7 +386,7 @@ static int _zzip_fnmatch(char* pattern, char* string, int flags)
  * next entry matching the given filespec. If no further entry is
  * found then null is returned and any "old"-entry gets already free()d.
  */
-ZZIP_ENTRY* _zzip_new
+zzip__new__ ZZIP_ENTRY*
 zzip_entry_findmatch(FILE* disk, char* filespec, 
                     ZZIP_ENTRY* _zzip_restrict entry,
                     zzip_fnmatch_fn_t compare, int flags)
@@ -416,13 +417,13 @@ zzip_entry_findmatch(FILE* disk, char* filespec,
 struct zzip_entry_file /* : zzip_file_header */
 {
     struct zzip_file_header header;    /* fopen detected header */
-    ZZIP_ENTRY* entry;                 /* fopen entry */
-    zzip_off_t  data;                  /* for stored blocks */
-    zzip_size_t avail;                 /* memorized for checks on EOF */
-    zzip_size_t compressed;            /* compressed flag and datasize */
-    zzip_size_t dataoff;               /* offset from data start */
-    z_stream zlib;                     /* for inflated blocks */
-    char     buffer[PAGESIZE];         /* work buffer for inflate algorithm */
+    ZZIP_ENTRY*   entry;               /* fopen entry */
+    zzip_off_t    data;                /* for stored blocks */
+    zzip_size_t   avail;               /* memorized for checks on EOF */
+    zzip_size_t   compressed;          /* compressed flag and datasize */
+    zzip_size_t   dataoff;             /* offset from data start */
+    z_stream      zlib;                /* for inflated blocks */
+    unsigned char buffer[PAGESIZE];    /* work buffer for inflate algorithm */
 };
 
 /** open a file within a zip disk for reading
@@ -437,7 +438,7 @@ struct zzip_entry_file /* : zzip_file_header */
  * the size of the internal readahead buffer. If an error occurs then null
  * is returned.
  */
-ZZIP_ENTRY_FILE* _zzip_new
+zzip__new__ ZZIP_ENTRY_FILE*
 zzip_entry_fopen (ZZIP_ENTRY* entry, int takeover)
 {
     if (! entry) return 0;
@@ -493,7 +494,7 @@ zzip_entry_fopen (ZZIP_ENTRY* entry, int takeover)
  * the zip central directory with => zzip_entry_findfile and whatever
  * is found first is given to => zzip_entry_fopen
  */
-ZZIP_ENTRY_FILE* _zzip_new
+zzip__new__ ZZIP_ENTRY_FILE*
 zzip_entry_ffile (FILE* disk, char* filename)
 {
     ZZIP_ENTRY* entry = zzip_entry_findfile (disk, filename, 0, 0);
index 1145f467312361d2291fd6de3bfe5fd41313d8c9..cbe40f7db4afc2802428b0e5c1131efad47b2713 100644 (file)
@@ -33,10 +33,12 @@ typedef int (*zzip_fnmatch_fn_t)(char*, char*, int);
 zzip_entry_extern zzip_off_t
 zzip_entry_data_offset(ZZIP_ENTRY* entry);
 
-zzip_entry_extern ZZIP_ENTRY* _zzip_new
+zzip__new__
+zzip_entry_extern ZZIP_ENTRY*
 zzip_entry_findfirst(FILE* file);
 
-zzip_entry_extern ZZIP_ENTRY* _zzip_new
+zzip__new__
+zzip_entry_extern ZZIP_ENTRY*
 zzip_entry_findnext(ZZIP_ENTRY* _zzip_restrict entry);
 
 #define zzip_entry_findlast      zzip_entry_free
@@ -46,24 +48,28 @@ zzip_entry_findnext(ZZIP_ENTRY* _zzip_restrict entry);
 zzip_entry_extern int
 zzip_entry_free(ZZIP_ENTRY* entry);
 
-zzip_entry_extern char* _zzip_new
+zzip__new__
+zzip_entry_extern char*
 zzip_entry_strdup_name(ZZIP_ENTRY* entry);
 zzip_entry_extern char*
 zzip_entry_to_data(ZZIP_ENTRY* entry);
 
-zzip_entry_extern ZZIP_ENTRY* _zzip_new
+zzip__new__
+zzip_entry_extern ZZIP_ENTRY*
 zzip_entry_findfile(FILE* disk, char* filename, 
                    ZZIP_ENTRY* _zzip_restrict old,
                   zzip_strcmp_fn_t compare);
-zzip_entry_extern ZZIP_ENTRY* _zzip_new
+zzip__new__
+zzip_entry_extern ZZIP_ENTRY*
 zzip_entry_findmatch(FILE* disk, char* filespec, 
                     ZZIP_ENTRY* _zzip_restrict old,
                    zzip_fnmatch_fn_t compare, int flags);
-
-zzip_entry_extern ZZIP_ENTRY_FILE* _zzip_new
+zzip__new__
+zzip_entry_extern ZZIP_ENTRY_FILE*
 zzip_entry_fopen (ZZIP_ENTRY* entry, int takeover);
 
-zzip_entry_extern ZZIP_ENTRY_FILE* _zzip_new
+zzip__new__
+zzip_entry_extern ZZIP_ENTRY_FILE*
 zzip_entry_ffile (FILE* disk, char* filename);
 
 zzip_entry_extern _zzip_size_t
index 57b0a155f84ecf7497e0df19dca2798380747990..7d66352add827727a635e0733d61f41bff3872ed 100644 (file)
@@ -53,23 +53,22 @@ static const char* error[] = {
 
 #define ZZIP_EXTRA_zip64 0x0001
 typedef struct _zzip_extra_zip64 { /* ZIP64 extended information extra field */
-    char z_datatype[2]; /* Tag for this "extra" block type */
-    char z_datasize[2]; /* Size of this "extra" block */
-    char z_usize[8]; /* Original uncompressed file size */
-    char z_csize[8]; /* Size of compressed data */
-    char z_offset[8]; /* Offset of local header record */
-    char z_diskstart[4]; /* Number of the disk for file start*/
+    zzip_byte_t z_datatype[2]; /* Tag for this "extra" block type */
+    zzip_byte_t z_datasize[2]; /* Size of this "extra" block */
+    zzip_byte_t z_usize[8]; /* Original uncompressed file size */
+    zzip_byte_t z_csize[8]; /* Size of compressed data */
+    zzip_byte_t z_offset[8]; /* Offset of local header record */
+    zzip_byte_t z_diskstart[4]; /* Number of the disk for file start*/
 } zzip_extra_zip64;
 
 /*forward*/
 
-
-static ZZIP_MEM_ENTRY* _zzip_new
+zzip__new__ static ZZIP_MEM_ENTRY*
 zzip_mem_entry_new(ZZIP_DISK* disk, ZZIP_DISK_ENTRY* entry);
-static void
+zzip__new__ static void
 zzip_mem_entry_free(ZZIP_MEM_ENTRY* _zzip_restrict item);
 
-ZZIP_MEM_DISK* _zzip_new
+zzip__new__ ZZIP_MEM_DISK*
 zzip_mem_disk_new(void)
 {
     return calloc(1, sizeof(ZZIP_MEM_DISK)); 
@@ -77,7 +76,7 @@ zzip_mem_disk_new(void)
 
 /** create new diskdir handle. 
  *  wraps underlying zzip_disk_open. */
-ZZIP_MEM_DISK* _zzip_new
+zzip__new__ ZZIP_MEM_DISK*
 zzip_mem_disk_open(char* filename)
 {
     ZZIP_DISK* disk = zzip_disk_open(filename);
@@ -89,7 +88,7 @@ zzip_mem_disk_open(char* filename)
 
 /** create new diskdir handle. 
  *  wraps underlying zzip_disk_open. */
-ZZIP_MEM_DISK* _zzip_new
+zzip__new__ ZZIP_MEM_DISK*
 zzip_mem_disk_fdopen(int fd)
 {
     ZZIP_DISK* disk = zzip_disk_mmap(fd);
@@ -131,8 +130,8 @@ zzip_mem_disk_load(ZZIP_MEM_DISK* dir, ZZIP_DISK* disk)
  * right into the diskdir_entry for later usage in higher layers.
  * returns: new item, or null on error (setting errno)
  */
-ZZIP_MEM_ENTRY* _zzip_new
-zzip_mem_entry_new(ZZIP_DISK* disk, ZZIP_DISK_ENTRY* entry) 
+zzip__new__ ZZIP_MEM_ENTRY*
+zzip_mem_entry_new(ZZIP_DISK* disk, ZZIP_DISK_ENTRY* entry)
 {
     if (! disk || ! entry) { errno=EINVAL; return 0; }
     ___ ZZIP_MEM_ENTRY* item = calloc(1, sizeof(*item));
@@ -327,7 +326,7 @@ zzip_mem_disk_findmatch(ZZIP_MEM_DISK* dir,
     return 0;
 }
 
-ZZIP_MEM_DISK_FILE* _zzip_new
+zzip__new__ ZZIP_MEM_DISK_FILE*
 zzip_mem_entry_fopen (ZZIP_MEM_DISK* dir, ZZIP_MEM_ENTRY* entry) 
 {
     /* keep this in sync with zzip_disk_entry_fopen */
@@ -354,7 +353,7 @@ zzip_mem_entry_fopen (ZZIP_MEM_DISK* dir, ZZIP_MEM_ENTRY* entry)
     return file;
 }
 
-ZZIP_MEM_DISK_FILE* _zzip_new
+zzip__new__ ZZIP_MEM_DISK_FILE*
 zzip_mem_disk_fopen (ZZIP_MEM_DISK* dir, char* filename) 
 {
     ZZIP_MEM_ENTRY* entry = zzip_mem_disk_findfile (dir, filename, 0, 0);
index 876981039d48d51b60a82bb4f84a42e75683dcd6..4403282f7306b122f3e4523614eb580cca28f75a 100644 (file)
@@ -19,11 +19,11 @@ struct _zzip_mem_disk {
 #define zzip_mem_disk_extern
 #endif
 
-zzip_mem_disk_extern ZZIP_MEM_DISK* _zzip_new
+zzip_mem_disk_extern zzip__new__ ZZIP_MEM_DISK*
 zzip_mem_disk_new (void);
-zzip_mem_disk_extern ZZIP_MEM_DISK* _zzip_new
+zzip_mem_disk_extern zzip__new__ ZZIP_MEM_DISK*
 zzip_mem_disk_open (char* filename);
-zzip_mem_disk_extern ZZIP_MEM_DISK* _zzip_new
+zzip_mem_disk_extern zzip__new__ ZZIP_MEM_DISK*
 zzip_mem_disk_fdopen (int fd);
 zzip_mem_disk_extern void 
 zzip_mem_disk_close (ZZIP_MEM_DISK* _zzip_restrict dir);
@@ -48,7 +48,7 @@ _zzip_inline ZZIP_DISK* zzip_disk (ZZIP_MEM_DISK* dir) { return dir->disk; }
 struct _zzip_mem_entry {
     struct _zzip_mem_entry* zz_next;
     char*            zz_name;      /* zero-terminated (from "filename") */
-    char*            zz_data;      /* compressed content start (mmap addr) */
+    zzip_byte_t*     zz_data;      /* compressed content start (mmap addr) */
     int              zz_flags;     /* (from "z_flags") */
     int              zz_compr;     /* (from "z_compr") */
     long             zz_mktime;    /* (from "z_dostime") */
@@ -105,11 +105,12 @@ _zzip_inline char*
 zzip_mem_entry_to_comment(ZZIP_MEM_ENTRY* entry) {
     if (! entry) return 0;
     return _zzip_mem_entry_to_comment(entry); }
-_zzip_inline char* _zzip_new
+zzip__new__
+_zzip_inline char*
 zzip_mem_entry_strdup_name(ZZIP_MEM_ENTRY* entry) {
     if (! entry) return 0;
     return _zzip_mem_entry_strdup_name(entry); }
-_zzip_inline char*
+_zzip_inline zzip_byte_t*
 zzip_mem_entry_to_data(ZZIP_MEM_ENTRY* entry) {
     if (! entry) return 0;
     return _zzip_mem_entry_to_data(entry); }
@@ -143,9 +144,9 @@ zzip_mem_disk_findmatch(ZZIP_MEM_DISK* dir,
 
 typedef ZZIP_DISK_FILE ZZIP_MEM_DISK_FILE;
 
-ZZIP_MEM_DISK_FILE* _zzip_new
+zzip__new__ ZZIP_MEM_DISK_FILE*
 zzip_mem_entry_fopen (ZZIP_MEM_DISK* dir, ZZIP_MEM_ENTRY* entry);
-ZZIP_MEM_DISK_FILE* _zzip_new
+zzip__new__ ZZIP_MEM_DISK_FILE*
 zzip_mem_disk_fopen (ZZIP_MEM_DISK* dir, char* filename);
 _zzip_size_t
 zzip_mem_disk_fread (void* ptr, _zzip_size_t size, _zzip_size_t nmemb,
index 24895b7f6157ec5a055adbc3bb42dbc4e97cec6b..a3a4a46d922d10e7b8d95a3fbbebc96a48c66c1e 100644 (file)
  * This function does primary initialization of a disk-buffer struct.
  */
 int
-zzip_disk_init(ZZIP_DISK* disk, char* buffer, zzip_size_t buflen)
+zzip_disk_init(ZZIP_DISK* disk, void* buffer, zzip_size_t buflen)
 {
-    disk->buffer = buffer;
-    disk->endbuf = buffer+buflen;
+    disk->buffer = (zzip_byte_t*) buffer;
+    disk->endbuf = (zzip_byte_t*) buffer + buflen;
     disk->reserved = 0;
     disk->flags = 0;
     disk->mapped = 0;
@@ -81,7 +81,7 @@ zzip_disk_init(ZZIP_DISK* disk, char* buffer, zzip_size_t buflen)
 /** => zzip_disk_mmap
  * This function allocates a new disk-buffer with => malloc(3)
  */
-ZZIP_DISK* _zzip_restrict
+zzip__new__ ZZIP_DISK*
 zzip_disk_new(void)
 {
     ZZIP_DISK* disk = malloc(sizeof(disk));
@@ -97,7 +97,7 @@ zzip_disk_new(void)
  * successful then a newly allocated ZZIP_DISK* is returned with 
  * disk->buffer pointing to the mapview of the zipdisk content.
  */
-ZZIP_DISK* _zzip_restrict
+zzip__new__ ZZIP_DISK*
 zzip_disk_mmap(int fd)
 {
     struct stat st;
@@ -130,7 +130,7 @@ zzip_disk_munmap(ZZIP_DISK* disk)
  * memory block. Only if that fails too then we return null. Since handling
  * of disk->buffer is ambigous it should not be snatched away please.
  */
-ZZIP_DISK* _zzip_restrict
+ZZIP_DISK* zzip__new__
 zzip_disk_open(char* filename)
 {
 #  ifndef O_BINARY
@@ -142,7 +142,7 @@ zzip_disk_open(char* filename)
     if (fd <= 0) return 0;
     ___ ZZIP_DISK* disk = zzip_disk_mmap (fd);
     if (disk) return disk;
-    ___ char* buffer = malloc (st.st_size);
+    ___ zzip_byte_t* buffer = malloc (st.st_size);
     if (! buffer) return 0;
     if ((st.st_size == read (fd, buffer, st.st_size)) &&
        (disk = zzip_disk_new ())) 
@@ -177,10 +177,10 @@ zzip_disk_close(ZZIP_DISK* disk)
 #define _zzip_strndup strndup
 #else
 /* if your system does not have strndup: */
-static char* _zzip_restrict _zzip_strndup(char* p, int maxlen)
+zzip__new__ static char* _zzip_strndup(char* p, int maxlen)
 {
     if (! p) return 0;
-    ___ char* r = malloc (maxlen+1);
+    ___ zzip_byte_t* r = malloc (maxlen+1);
     if (! r) return r;
     strncpy (r, p, maxlen);
     r[maxlen] = '\0';
@@ -214,7 +214,7 @@ static int _zzip_strcasecmp(char* __zzip_restrict a, char* _zzip_restrict b)
  * the data block right after the file_header. Only disk->buffer would be
  * needed to perform the seek but we check the mmapped range end as well.
  */
-char*
+zzip_byte_t*
 zzip_disk_entry_to_data(ZZIP_DISK* disk, struct zzip_disk_entry* entry)
 {
     struct zzip_file_header* file = 
@@ -230,7 +230,7 @@ zzip_disk_entry_to_data(ZZIP_DISK* disk, struct zzip_disk_entry* entry)
 struct zzip_file_header*
 zzip_disk_entry_to_file_header(ZZIP_DISK* disk, struct zzip_disk_entry* entry)
 {
-    char* file_header = /* (struct zzip_file_header*) */
+    zzip_byte_t* file_header = /* (struct zzip_file_header*) */
        (disk->buffer + zzip_disk_entry_fileoffset (entry));
     if (disk->buffer > file_header || file_header >= disk->endbuf) 
        return 0;
@@ -244,7 +244,7 @@ zzip_disk_entry_to_file_header(ZZIP_DISK* disk, struct zzip_disk_entry* entry)
  * in the zip central directory but if not then we fallback to the filename
  * given in the file_header of each compressed data portion.
  */
-char* _zzip_restrict
+zzip__new__ char*
 zzip_disk_entry_strdup_name(ZZIP_DISK* disk, struct zzip_disk_entry* entry)
 {
     if (! disk || ! entry) return 0;
@@ -259,7 +259,8 @@ zzip_disk_entry_strdup_name(ZZIP_DISK* disk, struct zzip_disk_entry* entry)
     else
        return 0;
 
-    if (disk->buffer > name || name+len > disk->endbuf)
+    if ((zzip_byte_t*) name < disk->buffer || 
+       (zzip_byte_t*) name+len > disk->endbuf)
        return 0;
     
     return  _zzip_strndup (name, len); ____;
@@ -269,7 +270,7 @@ zzip_disk_entry_strdup_name(ZZIP_DISK* disk, struct zzip_disk_entry* entry)
  * This function is similar creating a reference to a zero terminated
  * string but it can only exist in the zip central directory entry.
  */
-char* _zzip_restrict
+zzip__new__ char*
 zzip_disk_entry_strdup_comment(ZZIP_DISK* disk, struct zzip_disk_entry* entry)
 {
     if (! disk || ! entry) return 0;
@@ -280,7 +281,8 @@ zzip_disk_entry_strdup_comment(ZZIP_DISK* disk, struct zzip_disk_entry* entry)
     else
        return 0;
 
-    if (disk->buffer > text || text+len > disk->endbuf)
+    if ((zzip_byte_t*) text < disk->buffer || 
+       (zzip_byte_t*) text+len > disk->endbuf)
        return 0;
     
     return  _zzip_strndup (text, len); ____;
@@ -320,10 +322,10 @@ zzip_disk_findfirst(ZZIP_DISK* disk)
 {
     if (disk->buffer > disk->endbuf-sizeof(struct zzip_disk_trailer))
        return 0;
-    ___ char* p = disk->endbuf-sizeof(struct zzip_disk_trailer);
+    ___ zzip_byte_t* p = disk->endbuf-sizeof(struct zzip_disk_trailer);
     for (; p >= disk->buffer ; p--)
     {
-       char* root; /* (struct zzip_disk_entry*) */
+       zzip_byte_t* root; /* (struct zzip_disk_entry*) */
        if (zzip_disk_trailer_check_magic(p)) {
            root =  disk->buffer + zzip_disk_trailer_get_rootseek (
                (struct zzip_disk_trailer*)p);
@@ -359,13 +361,13 @@ zzip_disk_findfirst(ZZIP_DISK* disk)
 struct zzip_disk_entry*
 zzip_disk_findnext(ZZIP_DISK* disk, struct zzip_disk_entry* entry)
 {
-    if ((char*)entry < disk->buffer || 
-       (char*)entry > disk->endbuf-sizeof(entry) ||
+    if ((zzip_byte_t*)entry < disk->buffer || 
+       (zzip_byte_t*)entry > disk->endbuf-sizeof(entry) ||
        ! zzip_disk_entry_check_magic (entry) ||
        zzip_disk_entry_sizeto_end (entry) > 64*1024)
        return 0;
     entry = zzip_disk_entry_to_next_entry (entry);
-    if ((char*)entry > disk->endbuf-sizeof(entry) ||
+    if ((zzip_byte_t*)entry > disk->endbuf-sizeof(entry) ||
        ! zzip_disk_entry_check_magic (entry) ||
        zzip_disk_entry_sizeto_end (entry) > 64*1024 ||
        zzip_disk_entry_skipto_end (entry) + sizeof(entry) > disk->endbuf)
@@ -458,7 +460,7 @@ zzip_disk_findmatch(ZZIP_DISK* disk, char* filespec,
  * _read() operations will be able to get the next data portion or
  * return an eof condition for that file part wrapped in the zip archive.
  */
-ZZIP_DISK_FILE* _zzip_restrict
+zzip__new__ ZZIP_DISK_FILE*
 zzip_disk_entry_fopen (ZZIP_DISK* disk, ZZIP_DISK_ENTRY* entry)
 {
     /* keep this in sync with zzip_mem_entry_fopen */
@@ -494,7 +496,7 @@ zzip_disk_entry_fopen (ZZIP_DISK* disk, ZZIP_DISK_ENTRY* entry)
  * the zip central directory with => zzip_disk_findfile and whatever
  * is found first is given to => zzip_disk_entry_fopen
  */
-ZZIP_DISK_FILE* _zzip_restrict
+zzip__new__ ZZIP_DISK_FILE*
 zzip_disk_fopen (ZZIP_DISK* disk, char* filename)
 {
     ZZIP_DISK_ENTRY* entry = zzip_disk_findfile (disk, filename, 0, 0);
index 7e228af9940db52d3c9e88fc21240fc7ac3ae301..5f434544800b945be3cd735000571484353d965b 100644 (file)
@@ -29,10 +29,10 @@ typedef struct zzip_disk       ZZIP_DISK;
  */
 struct zzip_disk
 {
-    char* buffer;      /* start of mmapped area, the base of all seekvals */
-    char* endbuf;      /* end of mmapped area, i.e. buffer + buflen */
-    char* reserved;    /* - for later extensions (might be renamed) */
-    char* user;        /* - free for applications (use this!) */
+    zzip_byte_t* buffer; /* start of mmapped area, the base of all seekvals */
+    zzip_byte_t* endbuf; /* end of mmapped area, i.e. buffer + buflen */
+    void* reserved;    /* - for later extensions (might be renamed) */
+    void* user;        /* - free for applications (use this!) */
     long  flags;       /* bit 0: findfile searches case-insensitive */
     long  mapped;      /* used for mmap() wrappers of zzip/__mmap.h */
     long  unused;      /* - for later extensions (might be renamed) */
@@ -45,18 +45,18 @@ typedef int (*zzip_fnmatch_fn_t)(char*, char*, int);
 #define zzip_disk_extern extern
 
 zzip_disk_extern int
-zzip_disk_init(ZZIP_DISK* disk, char* buffer, zzip_size_t buflen);
+zzip_disk_init(ZZIP_DISK* disk, void* buffer, zzip_size_t buflen);
 
-zzip_disk_extern ZZIP_DISK* _zzip_restrict
+zzip_disk_extern zzip__new__ ZZIP_DISK*
 zzip_disk_new(void);
 
-zzip_disk_extern ZZIP_DISK* _zzip_restrict
+zzip_disk_extern zzip__new__ ZZIP_DISK*
 zzip_disk_mmap(int fd);
 
 zzip_disk_extern int 
 zzip_disk_munmap(ZZIP_DISK* disk);
 
-zzip_disk_extern ZZIP_DISK*  _zzip_restrict
+zzip_disk_extern zzip__new__ ZZIP_DISK*
 zzip_disk_open(char* filename);
 
 zzip_disk_extern int
@@ -69,13 +69,13 @@ zzip_disk_findfirst(ZZIP_DISK* disk);
 zzip_disk_extern ZZIP_DISK_ENTRY*
 zzip_disk_findnext(ZZIP_DISK* disk, ZZIP_DISK_ENTRY* entry);
 
-char* _zzip_restrict
+zzip_disk_extern zzip__new__ char*
 zzip_disk_entry_strdup_name(ZZIP_DISK* disk, ZZIP_DISK_ENTRY* entry);
-char* _zzip_restrict
+zzip_disk_extern zzip__new__ char*
 zzip_disk_entry_strdup_comment(ZZIP_DISK* disk, ZZIP_DISK_ENTRY* entry);
-struct zzip_file_header*
+zzip_disk_extern struct zzip_file_header*
 zzip_disk_entry_to_file_header(ZZIP_DISK* disk, ZZIP_DISK_ENTRY* entry);
-char*
+zzip_disk_extern zzip_byte_t*
 zzip_disk_entry_to_data(ZZIP_DISK* disk, ZZIP_DISK_ENTRY* entry);
 
 zzip_disk_extern ZZIP_DISK_ENTRY*
@@ -88,10 +88,10 @@ zzip_disk_findmatch(ZZIP_DISK* disk,
                    zzip_fnmatch_fn_t compare, int flags);
 
 
-zzip_disk_extern ZZIP_DISK_FILE* _zzip_restrict
+zzip_disk_extern zzip__new__ ZZIP_DISK_FILE*
 zzip_disk_entry_fopen (ZZIP_DISK* disk, ZZIP_DISK_ENTRY* entry);
 
-zzip_disk_extern ZZIP_DISK_FILE* _zzip_restrict
+zzip_disk_extern zzip__new__ ZZIP_DISK_FILE*
 zzip_disk_fopen (ZZIP_DISK* disk, char* filename);
 
 zzip_disk_extern _zzip_size_t
@@ -108,11 +108,11 @@ zzip_disk_feof (ZZIP_DISK_FILE* file);
  */
 struct zzip_disk_file
 {
-    char* buffer;                      /* fopen disk->buffer */
-    char* endbuf;                      /* fopen disk->endbuf */
+    zzip_byte_t* buffer;               /* fopen disk->buffer */
+    zzip_byte_t* endbuf;               /* fopen disk->endbuf */
     zzip_size_t avail;                 /* memorized for checks on EOF */
     z_stream zlib;                     /* for inflated blocks */
-    char* stored;                      /* for stored blocks */
+    zzip_byte_t* stored;               /* for stored blocks */
 };
 #endif
 
index c1c0cd46acadd8efed4e2e40f83ab039b565b408..f792cdbe20a404c05aa086957a1c72f056d2a0a9 100644 (file)
@@ -26,6 +26,7 @@
 #include <stddef.h> /* size_t and friends */
 /* msvc6 has neither ssize_t (we assume "int") nor off_t (assume "long") */
 
+typedef unsigned char zzip_byte_t; // especially zlib decoding data
 
 typedef       _zzip_off64_t     zzip_off64_t;
 typedef       _zzip_off_t       zzip_off_t;
index d6932ecf4dbfc5b86a1daf7e11bc65c108810d79..4d345a1eeb9a5e0fcf277c495f3f7a85fdce9e61 100644 (file)
@@ -33,7 +33,7 @@
 /* per default, we use a little hack to correct bad z_rootseek parts */
 #define ZZIP_CORRECT_ROOTSEEK 1
 
-#if __GNUC__ >= 3 && __GNUC_MINOR__ >= 3
+#if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (__GNUC__ >= 4)
 # ifdef DEBUG
 # warning suppress a warning where the compiler should have optimized instead.
 # endif