diff options
| author | Michele Calgaro <michele.calgaro@yahoo.it> | 2024-10-28 13:39:23 +0900 | 
|---|---|---|
| committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2024-10-28 13:39:23 +0900 | 
| commit | 69e1261df646edf24612d7f953dac81182e7461b (patch) | |
| tree | 5d9a9e9600f0592c3732fe7c9402134fd22d6651 /src/3rdparty/zlib | |
| parent | c9a75bccc60b6ac092f76a2624115fd8935f4888 (diff) | |
| download | tqt-69e1261d.tar.gz tqt-69e1261d.zip | |
Drop Borland compiler specific code
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'src/3rdparty/zlib')
| -rw-r--r-- | src/3rdparty/zlib/win32/Makefile.bor | 107 | ||||
| -rw-r--r-- | src/3rdparty/zlib/zconf.h | 17 | ||||
| -rw-r--r-- | src/3rdparty/zlib/zconf.in.h | 17 | ||||
| -rw-r--r-- | src/3rdparty/zlib/zutil.c | 78 | ||||
| -rw-r--r-- | src/3rdparty/zlib/zutil.h | 17 | 
5 files changed, 10 insertions, 226 deletions
| diff --git a/src/3rdparty/zlib/win32/Makefile.bor b/src/3rdparty/zlib/win32/Makefile.bor deleted file mode 100644 index b802519ca..000000000 --- a/src/3rdparty/zlib/win32/Makefile.bor +++ /dev/null @@ -1,107 +0,0 @@ -# Makefile for zlib -# Borland C++ for Win32 -# -# Updated for zlib 1.2.x by Cosmin Truta, 11-Mar-2003 -# Last updated: 28-Aug-2003 -# -# Usage: -#  make -f win32/Makefile.bor -#  make -f win32/Makefile.bor LOCAL_ZLIB=-DASMV OBJA=match.obj OBJPA=+match.obj - -# ------------ Borland C++ ------------ - -# Optional nonstandard preprocessor flags (e.g. -DMAX_MEM_LEVEL=7) -# should be added to the environment via "set LOCAL_ZLIB=-DFOO" or -# added to the declaration of LOC here: -LOC = $(LOCAL_ZLIB) - -CC = bcc32 -AS = bcc32 -LD = bcc32 -AR = tlib -CFLAGS  = -a -d -k- -O2 $(LOC) -ASFLAGS = $(LOC) -LDFLAGS = $(LOC) - - -# variables -ZLIB_LIB = zlib.lib - -OBJ1  = adler32.obj compress.obj crc32.obj deflate.obj gzio.obj infback.obj -OBJ2  = inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj -#OBJA = -OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzio.obj+infback.obj -OBJP2 = +inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj -#OBJPA= - - -# targets -all: $(ZLIB_LIB) example.exe minigzip.exe - -.c.obj: -	$(CC) -c $(CFLAGS) $< - -.asm.obj: -	$(AS) -c $(ASFLAGS) $< - -adler32.obj: adler32.c zlib.h zconf.h - -compress.obj: compress.c zlib.h zconf.h - -crc32.obj: crc32.c zlib.h zconf.h crc32.h - -deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h - -gzio.obj: gzio.c zutil.h zlib.h zconf.h - -infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ - inffast.h inffixed.h - -inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ - inffast.h - -inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ - inffast.h inffixed.h - -inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h - -trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h - -uncompr.obj: uncompr.c zlib.h zconf.h - -zutil.obj: zutil.c zutil.h zlib.h zconf.h - -example.obj: example.c zlib.h zconf.h - -minigzip.obj: minigzip.c zlib.h zconf.h - - -# For the sake of the old Borland make, -# the command line is cut to fit in the MS-DOS 128 byte limit: -$(ZLIB_LIB): $(OBJ1) $(OBJ2) $(OBJA) -	-del $(ZLIB_LIB) -	$(AR) $(ZLIB_LIB) $(OBJP1) -	$(AR) $(ZLIB_LIB) $(OBJP2) -	$(AR) $(ZLIB_LIB) $(OBJPA) - - -# testing -test: example.exe minigzip.exe -	example -	echo hello world | minigzip | minigzip -d - -example.exe: example.obj $(ZLIB_LIB) -	$(LD) $(LDFLAGS) example.obj $(ZLIB_LIB) - -minigzip.exe: minigzip.obj $(ZLIB_LIB) -	$(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB) - - -# cleanup -clean: -	-del *.obj -	-del *.lib -	-del *.exe -	-del *.tds -	-del zlib.bak -	-del foo.gz diff --git a/src/3rdparty/zlib/zconf.h b/src/3rdparty/zlib/zconf.h index 3c21403fc..af321ab6f 100644 --- a/src/3rdparty/zlib/zconf.h +++ b/src/3rdparty/zlib/zconf.h @@ -99,7 +99,7 @@  #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))  #  define STDC  #endif -#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) +#if !defined(STDC) && defined(__GNUC__)  #  define STDC  #endif  #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) @@ -184,11 +184,7 @@  #  if (defined(__SMALL__) || defined(__MEDIUM__))       /* Turbo C small or medium model */  #    define SMALL_MEDIUM -#    ifdef __BORLANDC__ -#      define FAR _far -#    else -#      define FAR far -#    endif +#    define FAR far  #  endif  #endif @@ -197,7 +193,7 @@      * This is not mandatory, but it offers a little performance increase.      */  #  ifdef ZLIB_DLL -#    if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) +#    if defined(WIN32)  #      ifdef ZLIB_INTERNAL  #        define ZEXTERN extern __declspec(dllexport)  #      else @@ -257,12 +253,7 @@ typedef unsigned char  Byte;  /* 8 bits */  typedef unsigned int   uInt;  /* 16 bits or more */  typedef unsigned long  uLong; /* 32 bits or more */ -#ifdef SMALL_MEDIUM -   /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ -#  define Bytef Byte FAR -#else -   typedef Byte  FAR Bytef; -#endif +typedef Byte  FAR Bytef;  typedef char  FAR charf;  typedef int   FAR intf;  typedef uInt  FAR uIntf; diff --git a/src/3rdparty/zlib/zconf.in.h b/src/3rdparty/zlib/zconf.in.h index 3c21403fc..af321ab6f 100644 --- a/src/3rdparty/zlib/zconf.in.h +++ b/src/3rdparty/zlib/zconf.in.h @@ -99,7 +99,7 @@  #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))  #  define STDC  #endif -#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) +#if !defined(STDC) && defined(__GNUC__)  #  define STDC  #endif  #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) @@ -184,11 +184,7 @@  #  if (defined(__SMALL__) || defined(__MEDIUM__))       /* Turbo C small or medium model */  #    define SMALL_MEDIUM -#    ifdef __BORLANDC__ -#      define FAR _far -#    else -#      define FAR far -#    endif +#    define FAR far  #  endif  #endif @@ -197,7 +193,7 @@      * This is not mandatory, but it offers a little performance increase.      */  #  ifdef ZLIB_DLL -#    if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) +#    if defined(WIN32)  #      ifdef ZLIB_INTERNAL  #        define ZEXTERN extern __declspec(dllexport)  #      else @@ -257,12 +253,7 @@ typedef unsigned char  Byte;  /* 8 bits */  typedef unsigned int   uInt;  /* 16 bits or more */  typedef unsigned long  uLong; /* 32 bits or more */ -#ifdef SMALL_MEDIUM -   /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ -#  define Bytef Byte FAR -#else -   typedef Byte  FAR Bytef; -#endif +typedef Byte  FAR Bytef;  typedef char  FAR charf;  typedef int   FAR intf;  typedef uInt  FAR uIntf; diff --git a/src/3rdparty/zlib/zutil.c b/src/3rdparty/zlib/zutil.c index 0ef4f99f5..11cafad6b 100644 --- a/src/3rdparty/zlib/zutil.c +++ b/src/3rdparty/zlib/zutil.c @@ -185,84 +185,6 @@ void zmemzero(dest, len)  #ifdef SYS16BIT -#ifdef __TURBOC__ -/* Turbo C in 16-bit mode */ - -#  define MY_ZCALLOC - -/* Turbo C malloc() does not allow dynamic allocation of 64K bytes - * and farmalloc(64K) returns a pointer with an offset of 8, so we - * must fix the pointer. Warning: the pointer must be put back to its - * original form in order to free it, use zcfree(). - */ - -#define MAX_PTR 10 -/* 10*64K = 640K */ - -local int next_ptr = 0; - -typedef struct ptr_table_s { -    voidpf org_ptr; -    voidpf new_ptr; -} ptr_table; - -local ptr_table table[MAX_PTR]; -/* This table is used to remember the original form of pointers - * to large buffers (64K). Such pointers are normalized with a zero offset. - * Since MSDOS is not a preemptive multitasking OS, this table is not - * protected from concurrent access. This hack doesn't work anyway on - * a protected system like OS/2. Use Microsoft C instead. - */ - -voidpf zcalloc (voidpf opaque, unsigned items, unsigned size) -{ -    voidpf buf = opaque; /* just to make some compilers happy */ -    ulg bsize = (ulg)items*size; - -    /* If we allocate less than 65520 bytes, we assume that farmalloc -     * will return a usable pointer which doesn't have to be normalized. -     */ -    if (bsize < 65520L) { -        buf = farmalloc(bsize); -        if (*(ush*)&buf != 0) return buf; -    } else { -        buf = farmalloc(bsize + 16L); -    } -    if (buf == NULL || next_ptr >= MAX_PTR) return NULL; -    table[next_ptr].org_ptr = buf; - -    /* Normalize the pointer to seg:0 */ -    *((ush*)&buf+1) += ((ush)((uch*)buf-0) + 15) >> 4; -    *(ush*)&buf = 0; -    table[next_ptr++].new_ptr = buf; -    return buf; -} - -void  zcfree (voidpf opaque, voidpf ptr) -{ -    int n; -    if (*(ush*)&ptr != 0) { /* object < 64K */ -        farfree(ptr); -        return; -    } -    /* Find the original pointer */ -    for (n = 0; n < next_ptr; n++) { -        if (ptr != table[n].new_ptr) continue; - -        farfree(table[n].org_ptr); -        while (++n < next_ptr) { -            table[n-1] = table[n]; -        } -        next_ptr--; -        return; -    } -    ptr = opaque; /* just to make some compilers happy */ -    Assert(0, "zcfree: ptr not found"); -} - -#endif /* __TURBOC__ */ - -  #ifdef M_I86  /* Microsoft C in 16-bit mode */ diff --git a/src/3rdparty/zlib/zutil.h b/src/3rdparty/zlib/zutil.h index 7b42edcaa..50bcbbf6e 100644 --- a/src/3rdparty/zlib/zutil.h +++ b/src/3rdparty/zlib/zutil.h @@ -76,17 +76,7 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */  #if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32))  #  define OS_CODE  0x00 -#  if defined(__TURBOC__) || defined(__BORLANDC__) -#    if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__)) -       /* Allow compilation with ANSI keywords only enabled */ -       void _Cdecl farfree( void *block ); -       void *_Cdecl farmalloc( unsigned long nbytes ); -#    else -#      include <alloc.h> -#    endif -#  else /* MSC or DJGPP */ -#    include <malloc.h> -#  endif +#  include <malloc.h>  #endif  #ifdef AMIGA @@ -160,7 +150,7 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */           /* functions */ -#if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550) +#if defined(STDC99)  #  ifndef HAVE_VSNPRINTF  #    define HAVE_VSNPRINTF  #  endif @@ -176,9 +166,6 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */          but for now we just assume it doesn't. */  #    define NO_vsnprintf  #  endif -#  ifdef __TURBOC__ -#    define NO_vsnprintf -#  endif  #  ifdef WIN32       /* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */  #    if !defined(vsnprintf) && !defined(NO_vsnprintf) | 
