]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Remove extern C blocks from lib/* internal APIs (except xxhash.h)
authorVictor Zhang <csv@meta.com>
Fri, 20 Dec 2024 00:00:11 +0000 (16:00 -0800)
committerVictor Zhang <csv@meta.com>
Fri, 20 Dec 2024 00:00:11 +0000 (16:00 -0800)
17 files changed:
lib/common/error_private.h
lib/common/huf.h
lib/common/mem.h
lib/common/pool.h
lib/common/threading.h
lib/common/zstd_internal.h
lib/common/zstd_trace.h
lib/compress/zstd_compress_internal.h
lib/compress/zstd_cwksp.h
lib/compress/zstd_double_fast.h
lib/compress/zstd_fast.h
lib/compress/zstd_lazy.h
lib/compress/zstd_ldm.h
lib/compress/zstd_opt.h
lib/compress/zstd_preSplit.h
lib/compress/zstdmt_compress.h
lib/dictBuilder/divsufsort.h

index 06233aaa8ebeea995d61fbc428c4ce73bf303d34..9dcc8595123cd70c8e3a7808ab36da8402141d08 100644 (file)
 #include "debug.h"
 #include "zstd_deps.h"       /* size_t */
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
 /* ****************************************
 *  Compiler-specific
 ******************************************/
@@ -159,8 +155,4 @@ void _force_has_format_string(const char *format, ...) {
         }                                                                          \
     } while(0)
 
-#if defined (__cplusplus)
-}
-#endif
-
 #endif /* ERROR_H_MODULE */
index 962fe43fa73ad7da43010b84b2efa42447b504aa..4b142c4f996c1f9cc77d38270091f5948d049aa2 100644 (file)
 #define FSE_STATIC_LINKING_ONLY
 #include "fse.h"
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
 /* ***   Tool functions *** */
 #define HUF_BLOCKSIZE_MAX (128 * 1024)   /**< maximum input size for a single block compressed with HUF_compress */
 size_t HUF_compressBound(size_t size);   /**< maximum compressed size (worst case) */
@@ -278,8 +274,4 @@ size_t HUF_readDTableX1_wksp(HUF_DTable* DTable, const void* src, size_t srcSize
 size_t HUF_readDTableX2_wksp(HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize, int flags);
 #endif
 
-#if defined (__cplusplus)
-}
-#endif
-
 #endif   /* HUF_H_298734234 */
index 1b0a946ad155a6e01b45dc5ffaaa448c3e1192e4..ca756e23711083be8e19949e93f347a835742748 100644 (file)
   typedef   signed long long  S64;
 #endif
 
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
 /*-**************************************************************
 *  Memory I/O API
 *****************************************************************/
@@ -424,9 +419,4 @@ MEM_STATIC void MEM_writeBEST(void* memPtr, size_t val)
 /* code only tested on 32 and 64 bits systems */
 MEM_STATIC void MEM_check(void) { DEBUG_STATIC_ASSERT((sizeof(size_t)==4) || (sizeof(size_t)==8)); }
 
-
-#if defined (__cplusplus)
-}
-#endif
-
 #endif /* MEM_H_MODULE */
index d34082dc1fcf80b95b40acd467a1d90f024b811b..f39b7f1eb99e7f90485746df68275acfb93c959e 100644 (file)
 #define ZSTD_STATIC_LINKING_ONLY   /* ZSTD_customMem */
 #include "../zstd.h"
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
 typedef struct POOL_ctx_s POOL_ctx;
 
 /*! POOL_create() :
@@ -82,9 +78,4 @@ void POOL_add(POOL_ctx* ctx, POOL_function function, void* opaque);
  */
 int POOL_tryAdd(POOL_ctx* ctx, POOL_function function, void* opaque);
 
-
-#if defined (__cplusplus)
-}
-#endif
-
 #endif
index 85b6a3ac82387fb5135cf6811850aba4301b63f9..e123cdf14a3344a3d9e1c14f2cae9063c4b6f96f 100644 (file)
 #define ZSTD_pthread_cond_signal(a)     WakeConditionVariable((a))
 #define ZSTD_pthread_cond_broadcast(a)  WakeAllConditionVariable((a))
 
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
 /* ZSTD_pthread_create() and ZSTD_pthread_join() */
 typedef HANDLE ZSTD_pthread_t;
 
@@ -73,20 +68,10 @@ int ZSTD_pthread_join(ZSTD_pthread_t thread);
  * add here more wrappers as required
  */
 
-
-#if defined (__cplusplus)
-}
-#endif
-
 #elif defined(ZSTD_MULTITHREAD)    /* posix assumed ; need a better detection method */
 /* ===   POSIX Systems   === */
 #  include <pthread.h>
 
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
 #if DEBUGLEVEL < 1
 
 #define ZSTD_pthread_mutex_t            pthread_mutex_t
@@ -133,17 +118,9 @@ int ZSTD_pthread_cond_destroy(ZSTD_pthread_cond_t* cond);
 
 #endif
 
-#if defined (__cplusplus)
-}
-#endif
-
 #else  /* ZSTD_MULTITHREAD not defined */
 /* No multithreading support */
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
 typedef int ZSTD_pthread_mutex_t;
 #define ZSTD_pthread_mutex_init(a, b)   ((void)(a), (void)(b), 0)
 #define ZSTD_pthread_mutex_destroy(a)   ((void)(a))
@@ -159,10 +136,6 @@ typedef int ZSTD_pthread_cond_t;
 
 /* do not use ZSTD_pthread_t */
 
-#if defined (__cplusplus)
-}
-#endif
-
 #endif /* ZSTD_MULTITHREAD */
 
 
index ecb9cfba87ccfef24c5526d86da9ea7546ace189..e40d15a05991878e26d411770062aeab8dd3e10b 100644 (file)
 #  define ZSTD_TRACE 0
 #endif
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
 /* ---- static assert (debug) --- */
 #define ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c)
 #define ZSTD_isError ERR_isError   /* for inlining */
@@ -385,8 +381,4 @@ MEM_STATIC int ZSTD_cpuSupportsBmi2(void)
     return ZSTD_cpuid_bmi1(cpuid) && ZSTD_cpuid_bmi2(cpuid);
 }
 
-#if defined (__cplusplus)
-}
-#endif
-
 #endif   /* ZSTD_CCOMMON_H_MODULE */
index b9187079c5d26d4e1131d093e7a0bf39bda3dfcf..198438a7c53e404be4b03c3519338016fdbbbf8b 100644 (file)
 
 #include <stddef.h>
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
 /* weak symbol support
  * For now, enable conservatively:
  * - Only GNUC
@@ -157,8 +153,4 @@ ZSTD_WEAK_ATTR void ZSTD_trace_decompress_end(
 
 #endif /* ZSTD_TRACE */
 
-#if defined (__cplusplus)
-}
-#endif
-
 #endif /* ZSTD_TRACE_H */
index 2d3510adc1c4d6c2b69d405cc34c630dd49c0ff0..bbca66cd3c97a86e91b144331b8343902a8a7ca9 100644 (file)
 #include "../common/bits.h" /* ZSTD_highbit32, ZSTD_NbCommonBytes */
 #include "zstd_preSplit.h" /* ZSTD_SLIPBLOCK_WORKSPACESIZE */
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
 /*-*************************************
 *  Constants
 ***************************************/
@@ -1426,10 +1422,6 @@ MEM_STATIC int ZSTD_comparePackedTags(size_t packedTag1, size_t packedTag2) {
     return tag1 == tag2;
 }
 
-#if defined (__cplusplus)
-}
-#endif
-
 /* ===============================================================
  * Shared internal declarations
  * These prototypes may be called from sources not in lib/compress
index aa4c3e49e08f49ef796c62cda88ea7c2b8d45c69..77518002d006b3d4520fbbbbb6cb016d7e901eca 100644 (file)
 #include "../common/portability_macros.h"
 #include "../common/compiler.h" /* ZS2_isPower2 */
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
 /*-*************************************
 *  Constants
 ***************************************/
@@ -766,8 +762,4 @@ MEM_STATIC void ZSTD_cwksp_bump_oversized_duration(
     }
 }
 
-#if defined (__cplusplus)
-}
-#endif
-
 #endif /* ZSTD_CWKSP_H */
index ae66f31427927c893cc193ca033a951f80f5b917..a4d4d345e984339177c7c8037fe55d5fc9f80b7d 100644 (file)
 #include "../common/mem.h"      /* U32 */
 #include "zstd_compress_internal.h"     /* ZSTD_CCtx, size_t */
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
 #ifndef ZSTD_EXCLUDE_DFAST_BLOCK_COMPRESSOR
 
 void ZSTD_fillDoubleHashTable(ZSTD_matchState_t* ms,
@@ -43,8 +39,4 @@ size_t ZSTD_compressBlock_doubleFast_extDict(
 #define ZSTD_COMPRESSBLOCK_DOUBLEFAST_EXTDICT NULL
 #endif /* ZSTD_EXCLUDE_DFAST_BLOCK_COMPRESSOR */
 
-#if defined (__cplusplus)
-}
-#endif
-
 #endif /* ZSTD_DOUBLE_FAST_H */
index f92cf35b9616fcfa0b92e0d1557659f7de3f5f28..8bbed8f9711f9a578037ff4437e0c23f3374c9d0 100644 (file)
 #include "../common/mem.h"      /* U32 */
 #include "zstd_compress_internal.h"
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
 void ZSTD_fillHashTable(ZSTD_matchState_t* ms,
                         void const* end, ZSTD_dictTableLoadMethod_e dtlm,
                         ZSTD_tableFillPurpose_e tfp);
@@ -31,8 +27,4 @@ size_t ZSTD_compressBlock_fast_extDict(
         ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
         void const* src, size_t srcSize);
 
-#if defined (__cplusplus)
-}
-#endif
-
 #endif /* ZSTD_FAST_H */
index bec17b1247e41c2c56b6fdee8923b0935a4ee147..cd4e1c7fa3954616b1ed26d63dc5e75d3176d1ed 100644 (file)
 
 #include "zstd_compress_internal.h"
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
 /**
  * Dedicated Dictionary Search Structure bucket log. In the
  * ZSTD_dedicatedDictSearch mode, the hashTable has
@@ -194,9 +190,4 @@ size_t ZSTD_compressBlock_btlazy2_extDict(
 #define ZSTD_COMPRESSBLOCK_BTLAZY2_EXTDICT NULL
 #endif
 
-
-#if defined (__cplusplus)
-}
-#endif
-
 #endif /* ZSTD_LAZY_H */
index 847c2befb1ee03044247c4b2e0dea4a5640f7944..592b95a9812e67bb4917883fab66365ee815f794 100644 (file)
 #include "zstd_compress_internal.h"   /* ldmParams_t, U32 */
 #include "../zstd.h"   /* ZSTD_CCtx, size_t */
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
 /*-*************************************
 *  Long distance matching
 ***************************************/
@@ -110,8 +106,4 @@ size_t ZSTD_ldm_getMaxNbSeq(ldmParams_t params, size_t maxChunkSize);
 void ZSTD_ldm_adjustParameters(ldmParams_t* params,
                                ZSTD_compressionParameters const* cParams);
 
-#if defined (__cplusplus)
-}
-#endif
-
 #endif /* ZSTD_FAST_H */
index 7ce6fdae7b17c105bfba432c5f6b694a876e7a1a..cace814948105e964faf5a2bceef71748e61474e 100644 (file)
 
 #include "zstd_compress_internal.h"
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
 #if !defined(ZSTD_EXCLUDE_BTLAZY2_BLOCK_COMPRESSOR) \
  || !defined(ZSTD_EXCLUDE_BTOPT_BLOCK_COMPRESSOR) \
  || !defined(ZSTD_EXCLUDE_BTULTRA_BLOCK_COMPRESSOR)
@@ -73,8 +69,4 @@ size_t ZSTD_compressBlock_btultra2(
 #define ZSTD_COMPRESSBLOCK_BTULTRA2 NULL
 #endif
 
-#if defined (__cplusplus)
-}
-#endif
-
 #endif /* ZSTD_OPT_H */
index d606a52b59eed0b4e24f448aff3d928a87b2cac0..b89a200dccd073d203418a6365b4c31800e5fad6 100644 (file)
 
 #include <stddef.h>  /* size_t */
 
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
 #define ZSTD_SLIPBLOCK_WORKSPACESIZE 8208
 
 /* ZSTD_splitBlock():
@@ -34,8 +30,4 @@ size_t ZSTD_splitBlock(const void* blockStart, size_t blockSize,
                     int level,
                     void* workspace, size_t wkspSize);
 
-#if defined (__cplusplus)
-}
-#endif
-
 #endif /* ZSTD_PRESPLIT_H */
index 9a58b5ad30d0e47101104e445d6a048c0e7fc784..91b489b9cb4f12df6a60728d22190a6e10751cc2 100644 (file)
 #define ZSTD_STATIC_LINKING_ONLY   /* ZSTD_parameters */
 #include "../zstd.h"            /* ZSTD_inBuffer, ZSTD_outBuffer, ZSTDLIB_API */
 
- #if defined (__cplusplus)
- extern "C" {
- #endif
-
-
 /* Note : This is an internal API.
  *        These APIs used to be exposed with ZSTDLIB_API,
  *        because it used to be the only way to invoke MT compression.
@@ -104,9 +99,4 @@ void ZSTDMT_updateCParams_whileCompressing(ZSTDMT_CCtx* mtctx, const ZSTD_CCtx_p
  */
 ZSTD_frameProgression ZSTDMT_getFrameProgression(ZSTDMT_CCtx* mtctx);
 
-
-#if defined (__cplusplus)
-}
-#endif
-
 #endif   /* ZSTDMT_COMPRESS_H */
index 5440994af15c1bf054207f0dca90dd285bb95aa6..3ed2b287ab1dde2682d3db0f17898eeb6fc3c543 100644 (file)
 #ifndef _DIVSUFSORT_H
 #define _DIVSUFSORT_H 1
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-
 /*- Prototypes -*/
 
 /**
@@ -59,9 +54,4 @@ divsufsort(const unsigned char *T, int *SA, int n, int openMP);
 int
 divbwt(const unsigned char *T, unsigned char *U, int *A, int n, unsigned char * num_indexes, int * indexes, int openMP);
 
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif /* __cplusplus */
-
 #endif /* _DIVSUFSORT_H */