Alias renamed API symbols

Add aliases for two renamed but unchanged symbols to avoid a useless
dependency. Add compiler warnings when compiling against the old symbols.

Gbp-Pq: Name 0018-Alias-renamed-API-symbols.patch
This commit is contained in:
Justin Aplin 2022-05-14 01:33:44 +08:00 committed by openKylinBot
parent f4821ab5ae
commit d089bba75c
2 changed files with 12 additions and 0 deletions

View File

@ -518,6 +518,10 @@ size_t ZSTD_CCtx_setParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, int value)
return ZSTD_CCtxParams_setParameter(&cctx->requestedParams, param, value);
}
size_t ZSTD_CCtxParam_setParameter(
ZSTD_CCtx_params* CCtxParams, ZSTD_cParameter param, int value)
__attribute__((alias("ZSTD_CCtxParams_setParameter")));
size_t ZSTD_CCtxParams_setParameter(ZSTD_CCtx_params* CCtxParams,
ZSTD_cParameter param, int value)
{
@ -706,6 +710,10 @@ size_t ZSTD_CCtx_getParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, int* value
return ZSTD_CCtxParams_getParameter(&cctx->requestedParams, param, value);
}
size_t ZSTD_CCtxParam_getParameter(
ZSTD_CCtx_params* CCtxParams, ZSTD_cParameter param, int* value)
__attribute__((alias("ZSTD_CCtxParams_getParameter")));
size_t ZSTD_CCtxParams_getParameter(
ZSTD_CCtx_params* CCtxParams, ZSTD_cParameter param, int* value)
{

View File

@ -1560,6 +1560,8 @@ ZSTDLIB_API size_t ZSTD_CCtxParams_init_advanced(ZSTD_CCtx_params* cctxParams, Z
* @result : 0, or an error code (which can be tested with ZSTD_isError()).
*/
ZSTDLIB_API size_t ZSTD_CCtxParams_setParameter(ZSTD_CCtx_params* params, ZSTD_cParameter param, int value);
ZSTDLIB_API size_t ZSTD_CCtxParam_setParameter(ZSTD_CCtx_params* params, ZSTD_cParameter param, int value)
__attribute__ ((deprecated ("Deprecated in 1.4.0, use ZSTD_CCtxParams_setParameter instead")));
/*! ZSTD_CCtxParams_getParameter() :
* Similar to ZSTD_CCtx_getParameter.
@ -1567,6 +1569,8 @@ ZSTDLIB_API size_t ZSTD_CCtxParams_setParameter(ZSTD_CCtx_params* params, ZSTD_c
* @result : 0, or an error code (which can be tested with ZSTD_isError()).
*/
ZSTDLIB_API size_t ZSTD_CCtxParams_getParameter(ZSTD_CCtx_params* params, ZSTD_cParameter param, int* value);
ZSTDLIB_API size_t ZSTD_CCtxParam_getParameter(ZSTD_CCtx_params* params, ZSTD_cParameter param, int* value)
__attribute__ ((deprecated ("Deprecated in 1.4.0, use ZSTD_CCtxParams_getParameter instead")));
/*! ZSTD_CCtx_setParametersUsingCCtxParams() :
* Apply a set of ZSTD_CCtx_params to the compression context.