Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/zstd_manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -2286,7 +2286,7 @@ <h3>Buffer-less streaming decompression functions</h3><pre></pre><b><pre></pre><

<pre><b>typedef enum { ZSTDnit_frameHeader, ZSTDnit_blockHeader, ZSTDnit_block, ZSTDnit_lastBlock, ZSTDnit_checksum, ZSTDnit_skippableFrame } ZSTD_nextInputType_e;
</b></pre><BR>
<pre><b>int ZSTD_isDeterministicBuild(void);
<pre><b>ZSTDLIB_STATIC_API int ZSTD_isDeterministicBuild(void);
</b><p> Returns 1 if the library is built using standard compilation flags,
and participates in determinism guarantees with other builds of the
same version.
Expand Down
2 changes: 1 addition & 1 deletion lib/zstd.h
Original file line number Diff line number Diff line change
Expand Up @@ -3239,7 +3239,7 @@ ZSTDLIB_STATIC_API ZSTD_nextInputType_e ZSTD_nextInputType(ZSTD_DCtx* dctx);
* This is mainly used for Zstd's determinism test suite, which is only
* run when this function returns 1.
*/
ZSTDLIB_API int ZSTD_isDeterministicBuild(void);
ZSTDLIB_STATIC_API int ZSTD_isDeterministicBuild(void);


/* ========================================= */
Expand Down
23 changes: 23 additions & 0 deletions tests/libzstd_builds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,26 @@ isPresent "zdict.o"
isPresent "zstd_v07.o"
mustBeAbsent "zbuff_compress.o"
$RM $DIR/../lib/libzstd.a tmplog

# exported symbols : the whole API by default,
# only the stable API when the experimental API is hidden.
# The API comes from the headers : -aux-info (GCC) lists their function declarations.
$ECHO "testing exported symbols"
printf '#include "zstd.h"\n#include "zdict.h"\n#include "zstd_errors.h"\n' > tmpapi.c
listDeclared() {
${CC:-cc} -I$DIR/../lib "$@" -fsyntax-only -aux-info tmpaux tmpapi.c
sed -n 's/^\/\*[^*]*\*\/ //; s/ (.*//; s/.*[ *]//p' tmpaux | $GREP -E '^(ZSTD|ZDICT)_' | LC_ALL=C sort -u
}
listExported() {
nm -D --defined-only $DIR/../lib/libzstd.so.*.*.* | awk '{ print $NF }' | LC_ALL=C sort -u
}
listDeclared > tmpstable
listDeclared -DZSTD_STATIC_LINKING_ONLY -DZDICT_STATIC_LINKING_ONLY > tmpall
CFLAGS= make -C $DIR/../lib libzstd > $INTOVOID
listExported > tmpexported
diff tmpall tmpexported || die "libzstd.so should export the whole API"
$RM $DIR/../lib/libzstd.so*
CFLAGS= make -C $DIR/../lib libzstd MOREFLAGS="-DZSTDLIB_STATIC_API=ZSTDLIB_HIDDEN -DZDICTLIB_STATIC_API=ZDICTLIB_HIDDEN" > $INTOVOID
listExported > tmpexported
diff tmpstable tmpexported || die "with the experimental API hidden, libzstd.so should export only the stable API"
$RM $DIR/../lib/libzstd.so* tmpapi.c tmpaux tmpstable tmpall tmpexported
Loading