11#ifndef PLATFORM_H_MODULE
12#define PLATFORM_H_MODULE
14#if defined (__cplusplus)
24# define _CRT_SECURE_NO_WARNINGS
25# define _CRT_NONSTDC_NO_WARNINGS
26# if (_MSC_VER <= 1800)
27# define _CRT_SECURE_NO_DEPRECATE
28# define snprintf sprintf_s
30# pragma warning(disable : 4127)
38#if defined __ia64 || defined _M_IA64 \
39 || defined __powerpc64__ || defined __ppc64__ || defined __PPC64__ \
40 || (defined __sparc && (defined __sparcv9 || defined __sparc_v9__ || defined __arch64__)) || defined __sparc64__ \
41 || defined __x86_64__s || defined _M_X64 \
42 || defined __arm64__ || defined __aarch64__ || defined __ARM64_ARCH_8__ \
43 || (defined __mips && (__mips == 64 || __mips == 4 || __mips == 3)) \
44 || defined _LP64 || defined __LP64__ || defined __64BIT__ || defined _ADDR64 \
45 || (defined __SIZEOF_POINTER__ && __SIZEOF_POINTER__ == 8)
46# if !defined(__64BIT__)
55#if !defined(__64BIT__) || defined(__MINGW32__)
56# if !defined(_FILE_OFFSET_BITS)
57# define _FILE_OFFSET_BITS 64
59# if !defined(_LARGEFILE_SOURCE)
60# define _LARGEFILE_SOURCE 1
62# if defined(_AIX) || defined(__hpux)
75#ifndef PLATFORM_POSIX_VERSION
77# if (defined(__APPLE__) && defined(__MACH__)) || defined(__SVR4) || defined(_AIX) || defined(__hpux) \
78 || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
81# define PLATFORM_POSIX_VERSION 200112L
90# elif !defined(_WIN32) \
91 && ( defined(__unix__) || defined(__unix) \
92 || defined(__midipix__) || defined(__VMS) || defined(__HAIKU__) )
94# if defined(__linux__) || defined(__linux) || defined(__CYGWIN__)
95# ifndef _POSIX_C_SOURCE
96# define _POSIX_C_SOURCE 200809L
100# if defined(_POSIX_VERSION)
101# define PLATFORM_POSIX_VERSION _POSIX_VERSION
103# define PLATFORM_POSIX_VERSION 1
113# define PLATFORM_POSIX_VERSION 0
119#if PLATFORM_POSIX_VERSION > 1
122# ifndef _ATFILE_SOURCE
123# define _ATFILE_SOURCE
135#if (defined(__linux__) && (PLATFORM_POSIX_VERSION > 1)) \
136 || (PLATFORM_POSIX_VERSION >= 200112L) \
137 || defined(__DJGPP__)
140# define IS_CONSOLE(stdStream) isatty(fileno(stdStream))
141#elif defined(MSDOS) || defined(OS2)
143# define IS_CONSOLE(stdStream) _isatty(_fileno(stdStream))
144#elif defined(WIN32) || defined(_WIN32)
148static __inline
int IS_CONSOLE(FILE* stdStream) {
150 return _isatty(_fileno(stdStream)) && GetConsoleMode((HANDLE)_get_osfhandle(_fileno(stdStream)), &
dummy);
153# define IS_CONSOLE(stdStream) 0
160#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(_WIN32)
163# if !defined(__DJGPP__)
165# include <winioctl.h>
166# define SET_BINARY_MODE(file) { int const unused=_setmode(_fileno(file), _O_BINARY); (void)unused; }
167# define SET_SPARSE_FILE_MODE(file) { DWORD dw; DeviceIoControl((HANDLE) _get_osfhandle(_fileno(file)), FSCTL_SET_SPARSE, 0, 0, 0, 0, &dw, 0); }
169# define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY)
170# define SET_SPARSE_FILE_MODE(file)
173# define SET_BINARY_MODE(file)
174# define SET_SPARSE_FILE_MODE(file)
178#ifndef ZSTD_SPARSE_DEFAULT
179# if (defined(__APPLE__) && defined(__MACH__))
180# define ZSTD_SPARSE_DEFAULT 0
182# define ZSTD_SPARSE_DEFAULT 1
187#ifndef ZSTD_START_SYMBOLLIST_FRAME
189# define ZSTD_START_SYMBOLLIST_FRAME 2
190# elif defined __APPLE__
191# define ZSTD_START_SYMBOLLIST_FRAME 4
193# define ZSTD_START_SYMBOLLIST_FRAME 0
198#ifndef ZSTD_SETPRIORITY_SUPPORT
200# define ZSTD_SETPRIORITY_SUPPORT (PLATFORM_POSIX_VERSION >= 200112L)
204#ifndef ZSTD_NANOSLEEP_SUPPORT
206# if (defined(__linux__) && (PLATFORM_POSIX_VERSION >= 199309L)) \
207 || (PLATFORM_POSIX_VERSION >= 200112L)
208# define ZSTD_NANOSLEEP_SUPPORT 1
210# define ZSTD_NANOSLEEP_SUPPORT 0
215#if defined (__cplusplus)
UINT32 DWORD
Definition 7zTypes.h:194
int dummy
Definition sandbox.c:18