mirror of
https://github.com/facebook/zstd.git
synced 2025-12-09 00:03:18 -05:00
[zdict] Fix static linking only include guards
Fix `zdict.h` static linking only section so if you include it twice it still exposes the static linking only symbols. E.g. this pattern: ``` ``` This can easily happen when a header you include includes `zdict.h`.
This commit is contained in:
parent
0c42424a1e
commit
2f7b8d47fb
14
lib/zdict.h
14
lib/zdict.h
@ -8,13 +8,12 @@
|
|||||||
* You may select, at your option, one of the above-listed licenses.
|
* You may select, at your option, one of the above-listed licenses.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef DICTBUILDER_H_001
|
|
||||||
#define DICTBUILDER_H_001
|
|
||||||
|
|
||||||
#if defined (__cplusplus)
|
#if defined (__cplusplus)
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef ZSTD_ZDICT_H
|
||||||
|
#define ZSTD_ZDICT_H
|
||||||
|
|
||||||
/*====== Dependencies ======*/
|
/*====== Dependencies ======*/
|
||||||
#include <stddef.h> /* size_t */
|
#include <stddef.h> /* size_t */
|
||||||
@ -272,9 +271,10 @@ ZDICTLIB_API size_t ZDICT_getDictHeaderSize(const void* dictBuffer, size_t dictS
|
|||||||
ZDICTLIB_API unsigned ZDICT_isError(size_t errorCode);
|
ZDICTLIB_API unsigned ZDICT_isError(size_t errorCode);
|
||||||
ZDICTLIB_API const char* ZDICT_getErrorName(size_t errorCode);
|
ZDICTLIB_API const char* ZDICT_getErrorName(size_t errorCode);
|
||||||
|
|
||||||
|
#endif /* ZSTD_ZDICT_H */
|
||||||
|
|
||||||
|
#if defined(ZDICT_STATIC_LINKING_ONLY) && !defined(ZSTD_ZDICT_H_STATIC)
|
||||||
#ifdef ZDICT_STATIC_LINKING_ONLY
|
#define ZSTD_ZDICT_H_STATIC
|
||||||
|
|
||||||
/* This can be overridden externally to hide static symbols. */
|
/* This can be overridden externally to hide static symbols. */
|
||||||
#ifndef ZDICTLIB_STATIC_API
|
#ifndef ZDICTLIB_STATIC_API
|
||||||
@ -467,10 +467,8 @@ size_t ZDICT_addEntropyTablesFromBuffer(void* dictBuffer, size_t dictContentSize
|
|||||||
const void* samplesBuffer, const size_t* samplesSizes, unsigned nbSamples);
|
const void* samplesBuffer, const size_t* samplesSizes, unsigned nbSamples);
|
||||||
|
|
||||||
|
|
||||||
#endif /* ZDICT_STATIC_LINKING_ONLY */
|
#endif /* ZSTD_ZDICT_H_STATIC */
|
||||||
|
|
||||||
#if defined (__cplusplus)
|
#if defined (__cplusplus)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* DICTBUILDER_H_001 */
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user