Skip to content

Commit

Permalink
Remove unnecessary extern C declarations from xxhash.h
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor-C-Zhang committed Dec 20, 2024
1 parent c727d5c commit 10b9d81
Showing 1 changed file with 0 additions and 90 deletions.
90 changes: 0 additions & 90 deletions lib/common/xxhash.h
Original file line number Diff line number Diff line change
Expand Up @@ -533,9 +533,6 @@
/*! @brief Version number, encoded as two digits each */
#define XXH_VERSION_NUMBER (XXH_VERSION_MAJOR *100*100 + XXH_VERSION_MINOR *100 + XXH_VERSION_RELEASE)

#if defined (__cplusplus)
extern "C" {
#endif
/*!
* @brief Obtains the xxHash version.
*
Expand All @@ -546,10 +543,6 @@ extern "C" {
*/
XXH_PUBLIC_API XXH_CONSTF unsigned XXH_versionNumber (void);

#if defined (__cplusplus)
}
#endif

/* ****************************
* Common basic types
******************************/
Expand Down Expand Up @@ -595,10 +588,6 @@ typedef uint32_t XXH32_hash_t;
# endif
#endif

#if defined (__cplusplus)
extern "C" {
#endif

/*!
* @}
*
Expand Down Expand Up @@ -827,10 +816,6 @@ XXH_PUBLIC_API XXH_PUREF XXH32_hash_t XXH32_hashFromCanonical(const XXH32_canoni
#endif
/*! @endcond */

#if defined (__cplusplus)
} /* end of extern "C" */
#endif

/*!
* @}
* @ingroup public
Expand Down Expand Up @@ -868,9 +853,6 @@ typedef uint64_t XXH64_hash_t;
# endif
#endif

#if defined (__cplusplus)
extern "C" {
#endif
/*!
* @}
*
Expand Down Expand Up @@ -1575,10 +1557,6 @@ XXH_PUBLIC_API XXH_PUREF XXH128_hash_t XXH128_hashFromCanonical(XXH_NOESCAPE con

#endif /* !XXH_NO_XXH3 */

#if defined (__cplusplus)
} /* extern "C" */
#endif

#endif /* XXH_NO_LONG_LONG */

/*!
Expand Down Expand Up @@ -1764,11 +1742,6 @@ struct XXH3_state_s {
tmp_xxh3_state_ptr->extSecret = NULL; \
} while(0)


#if defined (__cplusplus)
extern "C" {
#endif

/*!
* @brief Calculates the 128-bit hash of @p data using XXH3.
*
Expand Down Expand Up @@ -1984,10 +1957,6 @@ XXH3_128bits_reset_withSecretandSeed(XXH_NOESCAPE XXH3_state_t* statePtr,
XXH64_hash_t seed64);
#endif /* !XXH_NO_STREAM */

#if defined (__cplusplus)
} /* extern "C" */
#endif

#endif /* !XXH_NO_XXH3 */
#endif /* XXH_NO_LONG_LONG */

Expand Down Expand Up @@ -2308,17 +2277,9 @@ XXH3_128bits_reset_withSecretandSeed(XXH_NOESCAPE XXH3_state_t* statePtr,
* without access to dynamic allocation.
*/

#if defined (__cplusplus)
extern "C" {
#endif

static XXH_CONSTF void* XXH_malloc(size_t s) { (void)s; return NULL; }
static void XXH_free(void* p) { (void)p; }

#if defined (__cplusplus)
} /* extern "C" */
#endif

#else

/*
Expand All @@ -2327,9 +2288,6 @@ static void XXH_free(void* p) { (void)p; }
*/
#include <stdlib.h>

#if defined (__cplusplus)
extern "C" {
#endif
/*!
* @internal
* @brief Modify this function to use a different routine than malloc().
Expand All @@ -2342,15 +2300,8 @@ static XXH_MALLOCF void* XXH_malloc(size_t s) { return malloc(s); }
*/
static void XXH_free(void* p) { free(p); }

#if defined (__cplusplus)
} /* extern "C" */
#endif

#endif /* XXH_NO_STDLIB */

#if defined (__cplusplus)
extern "C" {
#endif
/*!
* @internal
* @brief Modify this function to use a different routine than memcpy().
Expand All @@ -2360,10 +2311,6 @@ static void* XXH_memcpy(void* dest, const void* src, size_t size)
return memcpy(dest,src,size);
}

#if defined (__cplusplus)
} /* extern "C" */
#endif

/* *************************************
* Compiler Specific Options
***************************************/
Expand Down Expand Up @@ -2497,10 +2444,6 @@ typedef XXH32_hash_t xxh_u32;
# define U32 xxh_u32
#endif

#if defined (__cplusplus)
extern "C" {
#endif

/* *** Memory access *** */

/*!
Expand Down Expand Up @@ -3657,10 +3600,6 @@ XXH_PUBLIC_API XXH64_hash_t XXH64_hashFromCanonical(XXH_NOESCAPE const XXH64_can
return XXH_readBE64(src);
}

#if defined (__cplusplus)
}
#endif

#ifndef XXH_NO_XXH3

/* *********************************************************************
Expand Down Expand Up @@ -3981,10 +3920,6 @@ enum XXH_VECTOR_TYPE /* fake enum */ {
# pragma GCC optimize("-O2")
#endif

#if defined (__cplusplus)
extern "C" {
#endif

#if XXH_VECTOR == XXH_NEON

/*
Expand Down Expand Up @@ -4107,10 +4042,6 @@ XXH_vmlal_high_u32(uint64x2_t acc, uint32x4_t lhs, uint32x4_t rhs)
# endif
#endif /* XXH_VECTOR == XXH_NEON */

#if defined (__cplusplus)
} /* extern "C" */
#endif

/*
* VSX and Z Vector helpers.
*
Expand Down Expand Up @@ -4172,9 +4103,6 @@ typedef xxh_u64x2 xxh_aliasing_u64x2 XXH_ALIASING;
# if defined(__POWER9_VECTOR__) || (defined(__clang__) && defined(__s390x__))
# define XXH_vec_revb vec_revb
# else
#if defined (__cplusplus)
extern "C" {
#endif
/*!
* A polyfill for POWER9's vec_revb().
*/
Expand All @@ -4184,15 +4112,9 @@ XXH_FORCE_INLINE xxh_u64x2 XXH_vec_revb(xxh_u64x2 val)
0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08 };
return vec_perm(val, val, vByteSwap);
}
#if defined (__cplusplus)
} /* extern "C" */
#endif
# endif
# endif /* XXH_VSX_BE */

#if defined (__cplusplus)
extern "C" {
#endif
/*!
* Performs an unaligned vector load and byte swaps it on big endian.
*/
Expand Down Expand Up @@ -4238,10 +4160,6 @@ XXH_FORCE_INLINE xxh_u64x2 XXH_vec_mule(xxh_u32x4 a, xxh_u32x4 b)
}
# endif /* XXH_vec_mulo, XXH_vec_mule */

#if defined (__cplusplus)
} /* extern "C" */
#endif

#endif /* XXH_VECTOR == XXH_VSX */

#if XXH_VECTOR == XXH_SVE
Expand Down Expand Up @@ -4275,9 +4193,6 @@ do { \
# endif
#endif /* XXH_NO_PREFETCH */

#if defined (__cplusplus)
extern "C" {
#endif
/* ==========================================
* XXH3 default settings
* ========================================== */
Expand Down Expand Up @@ -7080,11 +6995,6 @@ XXH3_generateSecret_fromSeed(XXH_NOESCAPE void* secretBuffer, XXH64_hash_t seed)
# pragma GCC pop_options
#endif


#if defined (__cplusplus)
} /* extern "C" */
#endif

#endif /* XXH_NO_LONG_LONG */
#endif /* XXH_NO_XXH3 */

Expand Down

0 comments on commit 10b9d81

Please sign in to comment.