Merge pull request #4218 from facebook/externC
Move #includes out of `extern "C"` blocks
This commit is contained in:
@@ -15,17 +15,12 @@
|
||||
* or detecting and returning an error
|
||||
*/
|
||||
|
||||
#if defined (__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef BENCH_FN_H_23876
|
||||
#define BENCH_FN_H_23876
|
||||
|
||||
/* === Dependencies === */
|
||||
#include <stddef.h> /* size_t */
|
||||
|
||||
|
||||
/* ==== Benchmark any function, iterated on a set of blocks ==== */
|
||||
|
||||
/* BMK_runTime_t: valid result return type */
|
||||
@@ -175,9 +170,4 @@ typedef union {
|
||||
} BMK_timedFnState_shell;
|
||||
BMK_timedFnState_t* BMK_initStatic_timedFnState(void* buffer, size_t size, unsigned total_ms, unsigned run_ms);
|
||||
|
||||
|
||||
#endif /* BENCH_FN_H_23876 */
|
||||
|
||||
#if defined (__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -14,10 +14,6 @@
|
||||
* and display progress result and final summary
|
||||
*/
|
||||
|
||||
#if defined (__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef BENCH_ZSTD_H_3242387
|
||||
#define BENCH_ZSTD_H_3242387
|
||||
|
||||
@@ -26,7 +22,6 @@ extern "C" {
|
||||
#define ZSTD_STATIC_LINKING_ONLY /* ZSTD_compressionParameters */
|
||||
#include "../lib/zstd.h" /* ZSTD_compressionParameters */
|
||||
|
||||
|
||||
/* === Constants === */
|
||||
|
||||
#define MB_UNIT 1000000
|
||||
@@ -194,7 +189,3 @@ BMK_benchOutcome_t BMK_benchMemAdvanced(const void* srcBuffer, size_t srcSize,
|
||||
|
||||
|
||||
#endif /* BENCH_ZSTD_H_3242387 */
|
||||
|
||||
#if defined (__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -14,6 +14,10 @@
|
||||
|
||||
#include <stddef.h> /* size_t */
|
||||
|
||||
#if defined (__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void RDG_genStdout(unsigned long long size, double matchProba, double litProba, unsigned seed);
|
||||
void RDG_genBuffer(void* buffer, size_t size, double matchProba, double litProba, unsigned seed);
|
||||
/*!RDG_genBuffer
|
||||
@@ -27,4 +31,8 @@ void RDG_genBuffer(void* buffer, size_t size, double matchProba, double litProba
|
||||
Same as RDG_genBuffer, but generates data into stdout
|
||||
*/
|
||||
|
||||
#if defined (__cplusplus)
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -17,11 +17,6 @@
|
||||
#define ZSTD_STATIC_LINKING_ONLY /* ZSTD_compressionParameters */
|
||||
#include "../lib/zstd.h" /* ZSTD_* */
|
||||
|
||||
#if defined (__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* *************************************
|
||||
* Special i/o constants
|
||||
**************************************/
|
||||
@@ -173,9 +168,4 @@ char const* FIO_zlibVersion(void);
|
||||
char const* FIO_lz4Version(void);
|
||||
char const* FIO_lzmaVersion(void);
|
||||
|
||||
|
||||
#if defined (__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* FILEIO_H_23981798732 */
|
||||
|
||||
@@ -22,10 +22,6 @@
|
||||
#ifndef ZSTD_FILEIO_ASYNCIO_H
|
||||
#define ZSTD_FILEIO_ASYNCIO_H
|
||||
|
||||
#if defined (__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../lib/common/mem.h" /* U32, U64 */
|
||||
#include "fileio_types.h"
|
||||
#include "platform.h"
|
||||
@@ -196,8 +192,4 @@ FILE* AIO_ReadPool_getFile(const ReadPoolCtx_t *ctx);
|
||||
* Closes the current set file. Waits for all current enqueued tasks to complete and resets state. */
|
||||
int AIO_ReadPool_closeFile(ReadPoolCtx_t *ctx);
|
||||
|
||||
#if defined (__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ZSTD_FILEIO_ASYNCIO_H */
|
||||
|
||||
@@ -11,10 +11,6 @@
|
||||
#ifndef ZSTD_FILEIO_COMMON_H
|
||||
#define ZSTD_FILEIO_COMMON_H
|
||||
|
||||
#if defined (__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../lib/common/mem.h" /* U32, U64 */
|
||||
#include "fileio_types.h"
|
||||
#include "platform.h"
|
||||
@@ -122,7 +118,4 @@ extern UTIL_time_t g_displayClock;
|
||||
# define LONG_TELL ftell
|
||||
#endif
|
||||
|
||||
#if defined (__cplusplus)
|
||||
}
|
||||
#endif
|
||||
#endif /* ZSTD_FILEIO_COMMON_H */
|
||||
|
||||
+10
-11
@@ -11,12 +11,6 @@
|
||||
#ifndef PLATFORM_H_MODULE
|
||||
#define PLATFORM_H_MODULE
|
||||
|
||||
#if defined (__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* **************************************
|
||||
* Compiler Options
|
||||
****************************************/
|
||||
@@ -144,10 +138,20 @@ extern "C" {
|
||||
# include <io.h> /* _isatty */
|
||||
# include <windows.h> /* DeviceIoControl, HANDLE, FSCTL_SET_SPARSE */
|
||||
# include <stdio.h> /* FILE */
|
||||
|
||||
#if defined (__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
static __inline int IS_CONSOLE(FILE* stdStream) {
|
||||
DWORD dummy;
|
||||
return _isatty(_fileno(stdStream)) && GetConsoleMode((HANDLE)_get_osfhandle(_fileno(stdStream)), &dummy);
|
||||
}
|
||||
|
||||
#if defined (__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#else
|
||||
# define IS_CONSOLE(stdStream) 0
|
||||
#endif
|
||||
@@ -210,9 +214,4 @@ static __inline int IS_CONSOLE(FILE* stdStream) {
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#if defined (__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* PLATFORM_H_MODULE */
|
||||
|
||||
@@ -11,12 +11,6 @@
|
||||
#ifndef TIME_FN_H_MODULE_287987
|
||||
#define TIME_FN_H_MODULE_287987
|
||||
|
||||
#if defined (__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*-****************************************
|
||||
* Types
|
||||
******************************************/
|
||||
@@ -62,9 +56,4 @@ PTime UTIL_clockSpanMicro(UTIL_time_t clockStart);
|
||||
|
||||
#define SEC_TO_MICRO ((PTime)1000000) /* nb of microseconds in a second */
|
||||
|
||||
|
||||
#if defined (__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* TIME_FN_H_MODULE_287987 */
|
||||
|
||||
@@ -8,11 +8,6 @@
|
||||
* You may select, at your option, one of the above-listed licenses.
|
||||
*/
|
||||
|
||||
#if defined (__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/*-****************************************
|
||||
* Dependencies
|
||||
******************************************/
|
||||
@@ -1646,7 +1641,3 @@ int UTIL_countLogicalCores(void)
|
||||
{
|
||||
return UTIL_countCores(1);
|
||||
}
|
||||
|
||||
#if defined (__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
+3
-1
@@ -20,6 +20,9 @@
|
||||
#include <sys/types.h> /* stat, utime */
|
||||
#include <sys/stat.h> /* stat, chmod */
|
||||
#include "../lib/common/mem.h" /* U64 */
|
||||
#if !(defined(_MSC_VER) || defined(__MINGW32__) || defined (__MSVCRT__))
|
||||
#include <libgen.h>
|
||||
#endif
|
||||
|
||||
/*-************************************************************
|
||||
* Fix fseek()'s 2GiB barrier with MSVC, macOS, *BSD, MinGW
|
||||
@@ -119,7 +122,6 @@ int UTIL_requireUserConfirmation(const char* prompt, const char* abortMsg, const
|
||||
#define STRDUP(s) _strdup(s)
|
||||
#else
|
||||
#define PATH_SEP '/'
|
||||
#include <libgen.h>
|
||||
#define STRDUP(s) strdup(s)
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user