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
131#if (defined(__linux__) && (PLATFORM_POSIX_VERSION > 1)) \
132 || (PLATFORM_POSIX_VERSION >= 200112L) \
133 || defined(__DJGPP__)
136# define IS_CONSOLE(stdStream) isatty(fileno(stdStream))
137#elif defined(MSDOS) || defined(OS2)
139# define IS_CONSOLE(stdStream) _isatty(_fileno(stdStream))
140#elif defined(WIN32) || defined(_WIN32)
144static __inline
int IS_CONSOLE(FILE* stdStream) {
146 return _isatty(_fileno(stdStream)) && GetConsoleMode((HANDLE)_get_osfhandle(_fileno(stdStream)), &
dummy);
149# define IS_CONSOLE(stdStream) 0
156#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(_WIN32)
159# if !defined(__DJGPP__)
161# include <winioctl.h>
162# define SET_BINARY_MODE(file) { int const unused=_setmode(_fileno(file), _O_BINARY); (void)unused; }
163# define SET_SPARSE_FILE_MODE(file) { DWORD dw; DeviceIoControl((HANDLE) _get_osfhandle(_fileno(file)), FSCTL_SET_SPARSE, 0, 0, 0, 0, &dw, 0); }
165# define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY)
166# define SET_SPARSE_FILE_MODE(file)
169# define SET_BINARY_MODE(file)
170# define SET_SPARSE_FILE_MODE(file)
174#ifndef ZSTD_SPARSE_DEFAULT
175# if (defined(__APPLE__) && defined(__MACH__))
176# define ZSTD_SPARSE_DEFAULT 0
178# define ZSTD_SPARSE_DEFAULT 1
183#ifndef ZSTD_START_SYMBOLLIST_FRAME
185# define ZSTD_START_SYMBOLLIST_FRAME 2
186# elif defined __APPLE__
187# define ZSTD_START_SYMBOLLIST_FRAME 4
189# define ZSTD_START_SYMBOLLIST_FRAME 0
194#ifndef ZSTD_SETPRIORITY_SUPPORT
196# define ZSTD_SETPRIORITY_SUPPORT (PLATFORM_POSIX_VERSION >= 200112L)
200#ifndef ZSTD_NANOSLEEP_SUPPORT
202# if (defined(__linux__) && (PLATFORM_POSIX_VERSION >= 199309L)) \
203 || (PLATFORM_POSIX_VERSION >= 200112L)
204# define ZSTD_NANOSLEEP_SUPPORT 1
206# define ZSTD_NANOSLEEP_SUPPORT 0
211#if defined (__cplusplus)
UINT32 DWORD
Definition 7zTypes.h:194
int dummy
Definition sandbox.c:18