Changeset 8e0d0c74 in rtems


Ignore:
Timestamp:
Mar 18, 2011, 10:11:45 AM (8 years ago)
Author:
Ralf Corsepius <ralf.corsepius@…>
Branches:
4.11, master
Children:
bf6f9b3d
Parents:
6557362
Message:

Import from zlib-1.2.5

Location:
cpukit/zlib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/zlib/gzguts.h

    r6557362 r8e0d0c74  
    66#ifdef _LARGEFILE64_SOURCE
    77#  ifndef _LARGEFILE_SOURCE
    8 #    define _LARGEFILE_SOURCE
     8#    define _LARGEFILE_SOURCE 1
    99#  endif
    1010#  ifdef _FILE_OFFSET_BITS
     
    1313#endif
    1414
    15 #define ZLIB_INTERNAL
     15#if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33) && !defined(NO_VIZ)
     16#  define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
     17#else
     18#  define ZLIB_INTERNAL
     19#endif
    1620
    1721#include <stdio.h>
     
    4549
    4650/* get errno and strerror definition */
    47 #if defined UNDER_CE && defined NO_ERRNO_H
     51#if defined UNDER_CE
    4852#  include <windows.h>
    4953#  define zstrerror() gz_strwinerror((DWORD)GetLastError())
     
    5761#endif
    5862
    59 /* MVS fdopen() */
    60 #ifdef __MVS__
    61   #pragma map (fdopen , "\174\174FDOPEN")
    62    FILE *fdopen(int, const char *);
    63 #endif
    64 
    65 #ifdef _LARGEFILE64_SOURCE
    66 #  define z_off64_t off64_t
    67 #else
    68 #  define z_off64_t z_off_t
     63/* provide prototypes for these when building zlib without LFS */
     64#if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0
     65    ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
     66    ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int));
     67    ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile));
     68    ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
    6969#endif
    7070
     
    117117
    118118/* shared functions */
    119 ZEXTERN void ZEXPORT gz_error OF((gz_statep, int, const char *));
    120 #if defined UNDER_CE && defined NO_ERRNO_H
    121 ZEXTERN char ZEXPORT *gz_strwinerror OF((DWORD error));
     119void ZLIB_INTERNAL gz_error OF((gz_statep, int, const char *));
     120#if defined UNDER_CE
     121char ZLIB_INTERNAL *gz_strwinerror OF((DWORD error));
    122122#endif
    123123
     
    128128#  define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > INT_MAX)
    129129#else
    130 ZEXTERN unsigned ZEXPORT gz_intmax OF((void));
     130unsigned ZLIB_INTERNAL gz_intmax OF((void));
    131131#  define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax())
    132132#endif
  • cpukit/zlib/zutil.h

    r6557362 r8e0d0c74  
    1414#define ZUTIL_H
    1515
    16 #define ZLIB_INTERNAL
     16#if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33) && !defined(NO_VIZ)
     17#  define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
     18#else
     19#  define ZLIB_INTERNAL
     20#endif
     21
    1722#include "zlib.h"
    1823
     
    2328#  include <string.h>
    2429#  include <stdlib.h>
    25 #endif
    26 
    27 #if defined(UNDER_CE) && defined(NO_ERRNO_H)
    28 #  define zseterrno(ERR) SetLastError((DWORD)(ERR))
    29 #  define zerrno() ((int)GetLastError())
    30 #else
    31 #  ifdef NO_ERRNO_H
    32      extern int errno;
    33 #  else
    34 #    include <errno.h>
    35 #  endif
    36 #  define zseterrno(ERR) do { errno = (ERR); } while (0)
    37 #  define zerrno() errno
    3830#endif
    3931
     
    168160#endif
    169161
    170 #ifdef _LARGEFILE64_SOURCE
    171 #  define z_off64_t off64_t
    172 #else
    173 #  define z_off64_t z_off_t
     162/* provide prototypes for these when building zlib without LFS */
     163#if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0
     164    ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
     165    ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
    174166#endif
    175167
     
    182174#ifndef F_OPEN
    183175#  define F_OPEN(name, mode) fopen((name), (mode))
    184 #endif
    185 
    186 #ifdef _LARGEFILE64_SOURCE
    187 #  define F_OPEN64(name, mode) fopen64((name), (mode))
    188 #else
    189 #  define F_OPEN64(name, mode) fopen((name), (mode))
    190176#endif
    191177
     
    251237#  endif
    252238#else
    253    extern void zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
    254    extern int  zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len));
    255    extern void zmemzero OF((Bytef* dest, uInt len));
     239   void ZLIB_INTERNAL zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
     240   int ZLIB_INTERNAL zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len));
     241   void ZLIB_INTERNAL zmemzero OF((Bytef* dest, uInt len));
    256242#endif
    257243
     
    259245#ifdef DEBUG
    260246#  include <stdio.h>
    261    extern int z_verbose;
    262    extern void z_error    OF((char *m));
     247   extern int ZLIB_INTERNAL z_verbose;
     248   extern void ZLIB_INTERNAL z_error OF((char *m));
    263249#  define Assert(cond,msg) {if(!(cond)) z_error(msg);}
    264250#  define Trace(x) {if (z_verbose>=0) fprintf x ;}
     
    277263
    278264
    279 voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size));
    280 void   zcfree  OF((voidpf opaque, voidpf ptr));
     265voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items,
     266                        unsigned size));
     267void ZLIB_INTERNAL zcfree  OF((voidpf opaque, voidpf ptr));
    281268
    282269#define ZALLOC(strm, items, size) \
Note: See TracChangeset for help on using the changeset viewer.