1
0
mirror of https://github.com/facebook/zstd.git synced 2025-07-29 11:21:22 +03:00

Remove unnecessary extern C declarations from programs/ and contrib/

This commit is contained in:
Victor Zhang
2024-12-19 16:20:23 -08:00
parent d0d5ce4c00
commit c727d5cd67
9 changed files with 8 additions and 58 deletions

View File

@ -7,9 +7,7 @@
* in the COPYING file in the root directory of this source tree). * in the COPYING file in the root directory of this source tree).
*/ */
#include "Pzstd.h" #include "Pzstd.h"
extern "C" {
#include "datagen.h" #include "datagen.h"
}
#include "test/RoundTrip.h" #include "test/RoundTrip.h"
#include "utils/ScopeGuard.h" #include "utils/ScopeGuard.h"

View File

@ -6,9 +6,7 @@
* LICENSE file in the root directory of this source tree) and the GPLv2 (found * LICENSE file in the root directory of this source tree) and the GPLv2 (found
* in the COPYING file in the root directory of this source tree). * in the COPYING file in the root directory of this source tree).
*/ */
extern "C" {
#include "datagen.h" #include "datagen.h"
}
#include "Options.h" #include "Options.h"
#include "test/RoundTrip.h" #include "test/RoundTrip.h"
#include "utils/ScopeGuard.h" #include "utils/ScopeGuard.h"

View File

@ -21,11 +21,6 @@
/* === Dependencies === */ /* === Dependencies === */
#include <stddef.h> /* size_t */ #include <stddef.h> /* size_t */
#if defined (__cplusplus)
extern "C" {
#endif
/* ==== Benchmark any function, iterated on a set of blocks ==== */ /* ==== Benchmark any function, iterated on a set of blocks ==== */
/* BMK_runTime_t: valid result return type */ /* BMK_runTime_t: valid result return type */
@ -175,9 +170,4 @@ typedef union {
} BMK_timedFnState_shell; } BMK_timedFnState_shell;
BMK_timedFnState_t* BMK_initStatic_timedFnState(void* buffer, size_t size, unsigned total_ms, unsigned run_ms); BMK_timedFnState_t* BMK_initStatic_timedFnState(void* buffer, size_t size, unsigned total_ms, unsigned run_ms);
#endif /* BENCH_FN_H_23876 */ #endif /* BENCH_FN_H_23876 */
#if defined (__cplusplus)
}
#endif

View File

@ -22,11 +22,6 @@
#define ZSTD_STATIC_LINKING_ONLY /* ZSTD_compressionParameters */ #define ZSTD_STATIC_LINKING_ONLY /* ZSTD_compressionParameters */
#include "../lib/zstd.h" /* ZSTD_compressionParameters */ #include "../lib/zstd.h" /* ZSTD_compressionParameters */
#if defined (__cplusplus)
extern "C" {
#endif
/* === Constants === */ /* === Constants === */
#define MB_UNIT 1000000 #define MB_UNIT 1000000
@ -194,7 +189,3 @@ BMK_benchOutcome_t BMK_benchMemAdvanced(const void* srcBuffer, size_t srcSize,
#endif /* BENCH_ZSTD_H_3242387 */ #endif /* BENCH_ZSTD_H_3242387 */
#if defined (__cplusplus)
}
#endif

View File

@ -14,6 +14,10 @@
#include <stddef.h> /* size_t */ #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_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); void RDG_genBuffer(void* buffer, size_t size, double matchProba, double litProba, unsigned seed);
/*!RDG_genBuffer /*!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 Same as RDG_genBuffer, but generates data into stdout
*/ */
#if defined (__cplusplus)
} /* extern "C" */
#endif
#endif #endif

View File

@ -17,11 +17,6 @@
#define ZSTD_STATIC_LINKING_ONLY /* ZSTD_compressionParameters */ #define ZSTD_STATIC_LINKING_ONLY /* ZSTD_compressionParameters */
#include "../lib/zstd.h" /* ZSTD_* */ #include "../lib/zstd.h" /* ZSTD_* */
#if defined (__cplusplus)
extern "C" {
#endif
/* ************************************* /* *************************************
* Special i/o constants * Special i/o constants
**************************************/ **************************************/
@ -173,9 +168,4 @@ char const* FIO_zlibVersion(void);
char const* FIO_lz4Version(void); char const* FIO_lz4Version(void);
char const* FIO_lzmaVersion(void); char const* FIO_lzmaVersion(void);
#if defined (__cplusplus)
}
#endif
#endif /* FILEIO_H_23981798732 */ #endif /* FILEIO_H_23981798732 */

View File

@ -31,10 +31,6 @@
#define MAX_IO_JOBS (10) #define MAX_IO_JOBS (10)
#if defined (__cplusplus)
extern "C" {
#endif
typedef struct { typedef struct {
/* These struct fields should be set only on creation and not changed afterwards */ /* These struct fields should be set only on creation and not changed afterwards */
POOL_ctx* threadPool; POOL_ctx* threadPool;
@ -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. */ * Closes the current set file. Waits for all current enqueued tasks to complete and resets state. */
int AIO_ReadPool_closeFile(ReadPoolCtx_t *ctx); int AIO_ReadPool_closeFile(ReadPoolCtx_t *ctx);
#if defined (__cplusplus)
}
#endif
#endif /* ZSTD_FILEIO_ASYNCIO_H */ #endif /* ZSTD_FILEIO_ASYNCIO_H */

View File

@ -23,10 +23,6 @@
# include <windows.h> # include <windows.h>
#endif #endif
#if defined (__cplusplus)
extern "C" {
#endif
/*-************************************* /*-*************************************
* Macros * Macros
***************************************/ ***************************************/
@ -124,7 +120,4 @@ extern UTIL_time_t g_displayClock;
# define LONG_TELL ftell # define LONG_TELL ftell
#endif #endif
#if defined (__cplusplus)
}
#endif
#endif /* ZSTD_FILEIO_COMMON_H */ #endif /* ZSTD_FILEIO_COMMON_H */

View File

@ -26,11 +26,6 @@
typedef unsigned long long PTime; /* does not support compilers without long long support */ typedef unsigned long long PTime; /* does not support compilers without long long support */
#endif #endif
#if defined (__cplusplus)
extern "C" {
#endif
/* UTIL_time_t contains a nanosecond time counter. /* UTIL_time_t contains a nanosecond time counter.
* The absolute value is not meaningful. * The absolute value is not meaningful.
* It's only valid to compute the difference between 2 measurements. */ * It's only valid to compute the difference between 2 measurements. */
@ -61,9 +56,4 @@ PTime UTIL_clockSpanMicro(UTIL_time_t clockStart);
#define SEC_TO_MICRO ((PTime)1000000) /* nb of microseconds in a second */ #define SEC_TO_MICRO ((PTime)1000000) /* nb of microseconds in a second */
#if defined (__cplusplus)
}
#endif
#endif /* TIME_FN_H_MODULE_287987 */ #endif /* TIME_FN_H_MODULE_287987 */