[1.5.0] Deprecate some functions#2582
Conversation
ff6b140 to
6b6c60a
Compare
|
I've added So I'm not entirely sure whether it would be better to update the internals of these wrapper functions or just let them keep using this API we're deprecating? cc @terrelln |
6b6c60a to
3e2b6d3
Compare
Nope, no need. |
As far as I know, |
5ce68d6 to
e1ea4b7
Compare
lib/zstd.h
Outdated
| /* Deprecation warnings : | ||
| * Should these warnings be a problem, it is generally possible to disable them, | ||
| * typically with -Wno-deprecated-declarations for gcc or _CRT_SECURE_NO_WARNINGS in Visual. | ||
| * Otherwise, it's also possible to define ZSTD_DISABLE_DEPRECATE_WARNINGS. | ||
| */ | ||
| #ifdef ZSTD_DISABLE_DEPRECATE_WARNINGS | ||
| # define ZSTD_DEPRECATED(message) ZSTDLIB_API /* disable deprecation warnings */ | ||
| #else | ||
| # if defined (__cplusplus) && (__cplusplus >= 201402) /* C++14 or greater */ | ||
| # define ZSTD_DEPRECATED(message) [[deprecated(message)]] ZSTDLIB_API | ||
| # elif (defined(GNUC) && (GNUC > 4 || (GNUC == 4 && GNUC_MINOR >= 5))) || defined(__clang__) | ||
| # define ZSTD_DEPRECATED(message) ZSTDLIB_API __attribute__((deprecated(message))) | ||
| # elif defined(__GNUC__) && (__GNUC__ >= 3) | ||
| # define ZSTD_DEPRECATED(message) ZSTDLIB_API __attribute__((deprecated)) | ||
| # elif defined(_MSC_VER) | ||
| # define ZSTD_DEPRECATED(message) ZSTDLIB_API __declspec(deprecated(message)) | ||
| # else | ||
| # pragma message("WARNING: You need to implement ZSTD_DEPRECATED for this compiler") | ||
| # define ZSTD_DEPRECATED(message) ZSTDLIB_API | ||
| # endif | ||
| #endif /* ZSTD_DISABLE_DEPRECATE_WARNINGS */ | ||
|
|
There was a problem hiding this comment.
nit: Can we move this to the top of the ZSTD_STATIC_LINKING_ONLY section?
I think that helps convey the message that we only deprecate functions in the unstable portion of our API. People who only use the stable section don't need to think about deprecation.
e1ea4b7 to
280b74b
Compare
We mark some functions as deprecated for the upcoming 1.5.0 release:
Functions that take
ZSTD_parametersas an argument:ZSTD_compress_advanced()ZSTD_compress_usingCDict_advanced()ZSTD_initCStream_advanced()ZSTD_initCStream_usingCDict_advanced()ZSTD_compressBegin_advanced()ZSTD_compressBegin_usingCDict_advanced()Functions that are redundant:
ZSTD_initCStream_srcSize()ZSTD_initCStream_usingDict()ZSTD_initCStream_usingCDict()ZSTD_resetCStream()ZSTD_DCtx_setFormat()In addition, we modify some build scripts (Make, CMake, VS) for
fuzzer,fullbench, andzstreamtestto ignore deprecated declarations since we still explicitly test some of these functions.In situations where it is appropriate, we also convert the deprecated API into the current API.
Some remaining
zbuffrelated build targets/paths that were missed in #2583 get removed too.