123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197 |
- #ifndef LZMA_SYSDEFS_H
- #define LZMA_SYSDEFS_H
- #ifdef HAVE_CONFIG_H
- # include <config.h>
- #endif
- #ifdef __MINGW32__
- # define __USE_MINGW_ANSI_STDIO 1
- #endif
- #include <stddef.h>
- #ifdef HAVE_INTTYPES_H
- # include <inttypes.h>
- #endif
- #ifdef HAVE_STDINT_H
- # include <stdint.h>
- #endif
- #include <limits.h>
- #ifndef UINT32_C
- # if UINT_MAX != 4294967295U
- # error UINT32_C is not defined and unsigned int is not 32-bit.
- # endif
- # define UINT32_C(n) n ## U
- #endif
- #ifndef UINT32_MAX
- # define UINT32_MAX UINT32_C(4294967295)
- #endif
- #ifndef PRIu32
- # define PRIu32 "u"
- #endif
- #ifndef PRIx32
- # define PRIx32 "x"
- #endif
- #ifndef PRIX32
- # define PRIX32 "X"
- #endif
- #if ULONG_MAX == 4294967295UL
- # ifndef UINT64_C
- # define UINT64_C(n) n ## ULL
- # endif
- # ifndef PRIu64
- # define PRIu64 "llu"
- # endif
- # ifndef PRIx64
- # define PRIx64 "llx"
- # endif
- # ifndef PRIX64
- # define PRIX64 "llX"
- # endif
- #else
- # ifndef UINT64_C
- # define UINT64_C(n) n ## UL
- # endif
- # ifndef PRIu64
- # define PRIu64 "lu"
- # endif
- # ifndef PRIx64
- # define PRIx64 "lx"
- # endif
- # ifndef PRIX64
- # define PRIX64 "lX"
- # endif
- #endif
- #ifndef UINT64_MAX
- # define UINT64_MAX UINT64_C(18446744073709551615)
- #endif
- #if defined(__INTERIX) || defined(_SCO_DS)
- # undef SIZE_MAX
- #endif
- #ifndef SIZE_MAX
- # if SIZEOF_SIZE_T == 4
- # define SIZE_MAX UINT32_MAX
- # elif SIZEOF_SIZE_T == 8
- # define SIZE_MAX UINT64_MAX
- # else
- # error size_t is not 32-bit or 64-bit
- # endif
- #endif
- #if SIZE_MAX != UINT32_MAX && SIZE_MAX != UINT64_MAX
- # error size_t is not 32-bit or 64-bit
- #endif
- #include <stdlib.h>
- #include <assert.h>
- #ifdef HAVE_STDBOOL_H
- # include <stdbool.h>
- #else
- # if ! HAVE__BOOL
- typedef unsigned char _Bool;
- # endif
- # define bool _Bool
- # define false 0
- # define true 1
- # define __bool_true_false_are_defined 1
- #endif
- #include <string.h>
- #if defined(_WIN32) && defined(_MSC_VER)
- # ifndef inline
- # define inline __inline
- # endif
- # ifndef restrict
- # define restrict __restrict
- # endif
- #endif
- #undef memzero
- #define memzero(s, n) memset(s, 0, n)
- #define my_min(x, y) ((x) < (y) ? (x) : (y))
- #define my_max(x, y) ((x) > (y) ? (x) : (y))
- #ifndef ARRAY_SIZE
- # define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
- #endif
- #if defined(__GNUC__) \
- && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 3) || __GNUC__ > 4)
- # define lzma_attr_alloc_size(x) __attribute__((__alloc_size__(x)))
- #else
- # define lzma_attr_alloc_size(x)
- #endif
- #endif
|