1
0
mirror of https://github.com/facebook/zstd.git synced 2025-07-30 22:23:13 +03:00

tools use platform.h

This commit is contained in:
Przemyslaw Skibinski
2016-12-16 14:24:01 +01:00
parent b3843afcf5
commit b866e72826
9 changed files with 27 additions and 9 deletions

View File

@ -11,7 +11,8 @@
/* *************************************
* Includes
***************************************/
#include "util.h" /* Compiler options, UTIL_GetFileSize, UTIL_sleep */
#include "platform.h" /* Compiler options */
#include "util.h" /* UTIL_GetFileSize, UTIL_sleep */
#include <stdlib.h> /* malloc, free */
#include <string.h> /* memset */
#include <stdio.h> /* fprintf, fopen, ftello64 */

View File

@ -12,7 +12,8 @@
/*-*************************************
* Includes
***************************************/
#include "util.h" /* Compiler options, UTIL_GetFileSize, UTIL_getTotalFileSize */
#include "platform.h" /* Compiler options */
#include "util.h" /* UTIL_GetFileSize, UTIL_getTotalFileSize */
#include <stdlib.h> /* malloc, free */
#include <string.h> /* memset */
#include <stdio.h> /* fprintf, fopen, ftello64 */

View File

@ -22,7 +22,8 @@
/*-*************************************
* Includes
***************************************/
#include "util.h" /* Compiler options, UTIL_GetFileSize, _LARGEFILE64_SOURCE */
#include "platform.h" /* Compiler options */
#include "util.h" /* UTIL_GetFileSize, _LARGEFILE64_SOURCE */
#include <stdio.h> /* fprintf, fopen, fread, _fileno, stdin, stdout */
#include <stdlib.h> /* malloc, free */
#include <string.h> /* strcmp, strlen */

View File

@ -30,7 +30,9 @@ extern "C" {
#endif
/* Unix Large Files support (>4GB) */
/* **************************************
* Unix Large Files support (>4GB)
****************************************/
#if !defined(__LP64__) /* No point defining Large file for 64 bit */
# define _FILE_OFFSET_BITS 64 /* turn off_t into a 64-bit type for ftello, fseeko */
# if defined(__sun__) && !defined(_LARGEFILE_SOURCE) /* Sun Solaris 32-bits requires specific definitions */
@ -41,6 +43,12 @@ extern "C" {
#endif
/* ***********************************************************
* Detect POSIX version
* PLATFORM_POSIX_VERSION = 0 for non-Unix e.g. Windows
* PLATFORM_POSIX_VERSION = 1 for Unix-like
* PLATFORM_POSIX_VERSION > 1 is equal to found _POSIX_VERSION
**************************************************************/
#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__)) || defined(__midipix__))
/* UNIX-style OS. ------------------------------------------- */
# if (defined(__APPLE__) && defined(__MACH__) || defined(__SVR4) || defined(_AIX) || defined(__hpux) \
@ -53,6 +61,8 @@ extern "C" {
# include <unistd.h> /* declares _POSIX_VERSION */
# if defined(_POSIX_VERSION) /* POSIX compliant */
# define PLATFORM_POSIX_VERSION _POSIX_VERSION
# else
# define PLATFORM_POSIX_VERSION 1
# endif
# endif
#endif
@ -62,6 +72,7 @@ extern "C" {
#endif
#if defined (__cplusplus)
}
#endif

View File

@ -23,7 +23,8 @@
/*-************************************
* Dependencies
**************************************/
#include "util.h" /* Compiler options, UTIL_HAS_CREATEFILELIST */
#include "platform.h" /* Compiler options, PLATFORM_POSIX_VERSION */
#include "util.h" /* UTIL_HAS_CREATEFILELIST, UTIL_createFileList */
#include <string.h> /* strcmp, strlen */
#include <errno.h> /* errno */
#include "fileio.h"

View File

@ -11,7 +11,7 @@
/*-************************************
* Dependencies
**************************************/
#include "util.h" /* Compiler options */
#include "platform.h" /* Compiler options */
#include <stdio.h> /* fprintf, stderr */
#include "datagen.h" /* RDG_generate */

View File

@ -11,7 +11,8 @@
/*_************************************
* Includes
**************************************/
#include "util.h" /* Compiler options, UTIL_GetFileSize */
#include "platform.h" /* Compiler options */
#include "util.h" /* UTIL_GetFileSize */
#include <stdlib.h> /* malloc */
#include <stdio.h> /* fprintf, fopen, ftello64 */
#include <time.h> /* clock_t, clock, CLOCKS_PER_SEC */

View File

@ -11,7 +11,8 @@
/*-************************************
* Dependencies
**************************************/
#include "util.h" /* Compiler options, UTIL_GetFileSize */
#include "platform.h" /* Compiler options */
#include "util.h" /* UTIL_GetFileSize */
#include <stdlib.h> /* malloc */
#include <stdio.h> /* fprintf, fopen, ftello64 */
#include <string.h> /* strcmp */

View File

@ -11,7 +11,8 @@
/* *************************************
* Includes
***************************************/
#include "util.h" /* Compiler options, UTIL_GetFileSize, UTIL_sleep */
#include "platform.h" /* Compiler options */
#include "util.h" /* UTIL_GetFileSize, UTIL_sleep */
#include <stdlib.h> /* malloc, free */
#include <string.h> /* memset */
#include <stdio.h> /* fprintf, fopen, ftello64 */