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)
80# define PLATFORM_POSIX_VERSION 200112L
89# elif !defined(_WIN32) \
90 && ( defined(__unix__) || defined(__unix) \
91 || defined(_QNX_SOURCE) || defined(__midipix__) || defined(__VMS) || defined(__HAIKU__) )
93# if defined(__linux__) || defined(__linux) || defined(__CYGWIN__)
94# ifndef _POSIX_C_SOURCE
95# define _POSIX_C_SOURCE 200809L
99# if defined(_POSIX_VERSION)
100# define PLATFORM_POSIX_VERSION _POSIX_VERSION
102# define PLATFORM_POSIX_VERSION 1
112# define PLATFORM_POSIX_VERSION 0
118#if PLATFORM_POSIX_VERSION > 1
121# ifndef _ATFILE_SOURCE
122# define _ATFILE_SOURCE
134#if (defined(__linux__) && (PLATFORM_POSIX_VERSION > 1)) \
135 || (PLATFORM_POSIX_VERSION >= 200112L) \
136 || defined(__DJGPP__)
139# define IS_CONSOLE(stdStream) isatty(fileno(stdStream))
140#elif defined(MSDOS) || defined(OS2)
142# define IS_CONSOLE(stdStream) _isatty(_fileno(stdStream))
147static __inline
int IS_CONSOLE(FILE* stdStream) {
149 return _isatty(_fileno(stdStream)) && GetConsoleMode((HANDLE)_get_osfhandle(_fileno(stdStream)), &
dummy);
152# define IS_CONSOLE(stdStream) 0
159#if defined(MSDOS) || defined(OS2) || defined(_WIN32)
162# if !defined(__DJGPP__)
164# include <winioctl.h>
165# define SET_BINARY_MODE(file) { int const unused=_setmode(_fileno(file), _O_BINARY); (void)unused; }
166# define SET_SPARSE_FILE_MODE(file) { DWORD dw; DeviceIoControl((HANDLE) _get_osfhandle(_fileno(file)), FSCTL_SET_SPARSE, 0, 0, 0, 0, &dw, 0); }
168# define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY)
169# define SET_SPARSE_FILE_MODE(file)
172# define SET_BINARY_MODE(file)
173# define SET_SPARSE_FILE_MODE(file)
177#ifndef ZSTD_SPARSE_DEFAULT
178# if (defined(__APPLE__) && defined(__MACH__))
179# define ZSTD_SPARSE_DEFAULT 0
181# define ZSTD_SPARSE_DEFAULT 1
186#ifndef ZSTD_START_SYMBOLLIST_FRAME
188# define ZSTD_START_SYMBOLLIST_FRAME 2
189# elif defined __APPLE__
190# define ZSTD_START_SYMBOLLIST_FRAME 4
192# define ZSTD_START_SYMBOLLIST_FRAME 0
197#ifndef ZSTD_SETPRIORITY_SUPPORT
199# define ZSTD_SETPRIORITY_SUPPORT (PLATFORM_POSIX_VERSION >= 200112L)
203#ifndef ZSTD_NANOSLEEP_SUPPORT
205# if (defined(__linux__) && (PLATFORM_POSIX_VERSION >= 199309L)) \
206 || (PLATFORM_POSIX_VERSION >= 200112L)
207# define ZSTD_NANOSLEEP_SUPPORT 1
209# define ZSTD_NANOSLEEP_SUPPORT 0
214#if defined (__cplusplus)
UINT32 DWORD
Definition 7zTypes.h:194
int dummy
Definition sandbox.c:18