Create z_size_t and z_ssize_t types.

Normally these are set to size_t and ssize_t. But if they do not
exist, then they are set to the smallest integer type that can
contain a pointer. size_t is unsigned and ssize_t is signed.
This commit is contained in:
Mark Adler
2016-12-03 10:27:14 -08:00
parent c5ee34c28a
commit ca50ebd4df
8 changed files with 144 additions and 17 deletions

View File

@@ -226,6 +226,21 @@
# define z_const
#endif
#ifndef Z_SOLO
# ifdef NO_SIZE_T
typedef unsigned NO_SIZE_T z_size_t;
# else
# include <stddef.h>
typedef size_t z_size_t;
# endif
# ifdef NO_SSIZE_T
typedef NO_SSIZE_T z_ssize_t;
# else
# include <sys/types.h>
typedef ssize_t z_ssize_t;
# endif
#endif
/* Maximum value for memLevel in deflateInit2 */
#ifndef MAX_MEM_LEVEL
# ifdef MAXSEG_64K