Skip to content

Commit

Permalink
Add source level deprecation warning disabling to certain tests/utils (
Browse files Browse the repository at this point in the history
  • Loading branch information
senhuang42 authored May 13, 2021
1 parent b57022e commit 40def70
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build/meson/contrib/pzstd/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pzstd_sources = [join_paths(zstd_rootdir, 'programs/util.c'),
join_paths(zstd_rootdir, 'contrib/pzstd/SkippableFrame.cpp')]
pzstd = executable('pzstd',
pzstd_sources,
cpp_args: [ '-DNDEBUG', '-Wno-shadow', '-pedantic' ],
cpp_args: [ '-DNDEBUG', '-Wno-shadow', '-pedantic', '-Wno-deprecated-declarations' ],
include_directories: pzstd_includes,
dependencies: [ libzstd_dep, thread_dep ],
install: true)
2 changes: 1 addition & 1 deletion build/meson/tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ fuzzer_sources = [join_paths(zstd_rootdir, 'programs/datagen.c'),
fuzzer = executable('fuzzer',
fuzzer_sources,
include_directories: test_includes,
dependencies: libzstd_dep,
dependencies: [ libzstd_dep, thread_dep ],
install: false)

zstreamtest_sources = [join_paths(zstd_rootdir, 'programs/datagen.c'),
Expand Down
3 changes: 3 additions & 0 deletions contrib/pzstd/Options.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
#pragma once

#define ZSTD_STATIC_LINKING_ONLY
#define ZSTD_DISABLE_DEPRECATE_WARNINGS /* No deprecation warnings, pzstd itself is deprecated
* and uses deprecated functions
*/
#include "zstd.h"
#undef ZSTD_STATIC_LINKING_ONLY

Expand Down
3 changes: 3 additions & 0 deletions contrib/pzstd/Pzstd.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
#include "utils/ThreadPool.h"
#include "utils/WorkQueue.h"
#define ZSTD_STATIC_LINKING_ONLY
#define ZSTD_DISABLE_DEPRECATE_WARNINGS /* No deprecation warnings, pzstd itself is deprecated
* and uses deprecated functions
*/
#include "zstd.h"
#undef ZSTD_STATIC_LINKING_ONLY

Expand Down
1 change: 1 addition & 0 deletions tests/fullbench.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#define GB *(1U<<30)
typedef enum { bt_raw, bt_rle, bt_compressed, bt_reserved } blockType_e;
#endif
#define ZSTD_DISABLE_DEPRECATE_WARNINGS /* No deprecation warnings, we still bench some deprecated functions */
#define ZSTD_STATIC_LINKING_ONLY /* ZSTD_compressBegin, ZSTD_compressContinue, etc. */
#include "zstd.h" /* ZSTD_versionString */
#include "util.h" /* time functions */
Expand Down
1 change: 1 addition & 0 deletions tests/fuzzer.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#define ZSTD_STATIC_LINKING_ONLY /* ZSTD_compressContinue, ZSTD_compressBlock */
#include "debug.h" /* DEBUG_STATIC_ASSERT */
#include "fse.h"
#define ZSTD_DISABLE_DEPRECATE_WARNINGS /* No deprecation warnings, we still test some deprecated functions */
#include "zstd.h" /* ZSTD_VERSION_STRING */
#include "zstd_errors.h" /* ZSTD_getErrorCode */
#define ZDICT_STATIC_LINKING_ONLY
Expand Down
1 change: 1 addition & 0 deletions tests/zstreamtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <assert.h> /* assert */
#include "timefn.h" /* UTIL_time_t, UTIL_getTime */
#include "mem.h"
#define ZSTD_DISABLE_DEPRECATE_WARNINGS /* No deprecation warnings, we still test some deprecated functions */
#define ZSTD_STATIC_LINKING_ONLY /* ZSTD_maxCLevel, ZSTD_customMem, ZSTD_getDictID_fromFrame */
#include "zstd.h" /* ZSTD_compressBound */
#include "zstd_errors.h" /* ZSTD_error_srcSize_wrong */
Expand Down

0 comments on commit 40def70

Please sign in to comment.