Skip to content

Commit

Permalink
add some guards and simplify zstd in package_build
Browse files Browse the repository at this point in the history
  • Loading branch information
lnkuiper committed Oct 23, 2024
1 parent 4eebba3 commit cf3c5b5
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
4 changes: 1 addition & 3 deletions scripts/package_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ def third_party_sources():
sources += [os.path.join('third_party', 'libpg_query')]
sources += [os.path.join('third_party', 'mbedtls')]
sources += [os.path.join('third_party', 'yyjson')]
sources += [os.path.join('third_party', 'zstd', 'common')]
sources += [os.path.join('third_party', 'zstd', 'compress')]
sources += [os.path.join('third_party', 'zstd', 'decompress')]
sources += [os.path.join('third_party', 'zstd')]
return sources


Expand Down
5 changes: 2 additions & 3 deletions third_party/zstd/include/zstd/common/allocations.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

/* This file provides custom allocation primitives
*/
#ifndef ZSTD_ALLOCATIONS_H
#define ZSTD_ALLOCATIONS_H

#define ZSTD_DEPS_NEED_MALLOC
#include "zstd/common/zstd_deps.h" /* ZSTD_malloc, ZSTD_calloc, ZSTD_free, ZSTD_memset */
Expand All @@ -18,9 +20,6 @@
#define ZSTD_STATIC_LINKING_ONLY
#include "zstd.h" /* ZSTD_customMem */

#ifndef ZSTD_ALLOCATIONS_H
#define ZSTD_ALLOCATIONS_H

namespace duckdb_zstd {

/* custom memory allocation functions */
Expand Down
4 changes: 4 additions & 0 deletions third_party/zstd/include/zstd/compress/hist.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* in the COPYING file in the root directory of this source tree).
* You may select, at your option, one of the above-listed licenses.
****************************************************************** */
#ifndef ZSTD_HIST_H
#define ZSTD_HIST_H

/* --- dependencies --- */
#include "zstd/common/zstd_deps.h" /* size_t */
Expand Down Expand Up @@ -76,3 +78,5 @@ unsigned HIST_count_simple(unsigned* count, unsigned* maxSymbolValuePtr,
const void* src, size_t srcSize);

} // namespace duckdb_zstd

#endif /* ZSTD_HIST_H */
5 changes: 3 additions & 2 deletions third_party/zstd/include/zstd/deprecated/zbuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* Dependencies
***************************************/
#include <stddef.h> /* size_t */
# define ZSTD_STATIC_LINKING_ONLY /* ZSTD_parameters, ZSTD_customMem */
#include "zstd.h" /* ZSTD_CStream, ZSTD_DStream, ZSTDLIB_API */

namespace duckdb_zstd {
Expand Down Expand Up @@ -183,8 +184,8 @@ ZBUFF_DEPRECATED("use ZSTD_DStreamOutSize") size_t ZBUFF_recommendedDOutSize(voi


/*--- Dependency ---*/
# define ZSTD_STATIC_LINKING_ONLY /* ZSTD_parameters, ZSTD_customMem */
#include "zstd.h"
//# define ZSTD_STATIC_LINKING_ONLY /* ZSTD_parameters, ZSTD_customMem */
//#include "zstd.h"

namespace duckdb_zstd {

Expand Down
5 changes: 5 additions & 0 deletions third_party/zstd/include/zstd/dict/cover.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
* You may select, at your option, one of the above-listed licenses.
*/

#ifndef ZSTD_COVER_H
#define ZSTD_COVER_H

#ifndef ZDICT_STATIC_LINKING_ONLY
# define ZDICT_STATIC_LINKING_ONLY
#endif
Expand Down Expand Up @@ -154,3 +157,5 @@ void COVER_dictSelectionFree(COVER_dictSelection_t selection);
size_t nbCheckSamples, size_t nbSamples, ZDICT_cover_params_t params, size_t* offsets, size_t totalCompressedSize);

} // namespace duckdb_zstd

#endif /* ZSTD_COVER_H */

0 comments on commit cf3c5b5

Please sign in to comment.