Skip to content

Commit 03acb7d

Browse files
committed
Move ZSTD_DEPRECATED before ZSTDLIB_STATIC_API
Clang doesn't allow [[deprecated(...)]] attribute after __attribute__. Move [[deprecated(...)]] before __attribute__ to fix C++14/C++17 uses with Clang. Fix #3250
1 parent 3587877 commit 03acb7d

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

lib/zstd.h

+13-13
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,8 @@ ZSTDLIB_API unsigned long long ZSTD_getFrameContentSize(const void *src, size_t
187187
* "empty", "unknown" and "error" results to the same return value (0),
188188
* while ZSTD_getFrameContentSize() gives them separate return values.
189189
* @return : decompressed size of `src` frame content _if known and not empty_, 0 otherwise. */
190-
ZSTDLIB_API
191190
ZSTD_DEPRECATED("Replaced by ZSTD_getFrameContentSize")
191+
ZSTDLIB_API
192192
unsigned long long ZSTD_getDecompressedSize(const void* src, size_t srcSize);
193193

194194
/*! ZSTD_findFrameCompressedSize() : Requires v1.4.0+
@@ -1710,8 +1710,8 @@ ZSTDLIB_STATIC_API ZSTD_compressionParameters ZSTD_adjustCParams(ZSTD_compressio
17101710
* Note : this function is now DEPRECATED.
17111711
* It can be replaced by ZSTD_compress2(), in combination with ZSTD_CCtx_setParameter() and other parameter setters.
17121712
* This prototype will generate compilation warnings. */
1713-
ZSTDLIB_STATIC_API
17141713
ZSTD_DEPRECATED("use ZSTD_compress2")
1714+
ZSTDLIB_STATIC_API
17151715
size_t ZSTD_compress_advanced(ZSTD_CCtx* cctx,
17161716
void* dst, size_t dstCapacity,
17171717
const void* src, size_t srcSize,
@@ -1722,8 +1722,8 @@ size_t ZSTD_compress_advanced(ZSTD_CCtx* cctx,
17221722
* Note : this function is now DEPRECATED.
17231723
* It can be replaced by ZSTD_compress2(), in combination with ZSTD_CCtx_loadDictionary() and other parameter setters.
17241724
* This prototype will generate compilation warnings. */
1725-
ZSTDLIB_STATIC_API
17261725
ZSTD_DEPRECATED("use ZSTD_compress2 with ZSTD_CCtx_loadDictionary")
1726+
ZSTDLIB_STATIC_API
17271727
size_t ZSTD_compress_usingCDict_advanced(ZSTD_CCtx* cctx,
17281728
void* dst, size_t dstCapacity,
17291729
const void* src, size_t srcSize,
@@ -2226,8 +2226,8 @@ ZSTDLIB_STATIC_API size_t ZSTD_DCtx_getParameter(ZSTD_DCtx* dctx, ZSTD_dParamete
22262226
* This instruction is mandatory to decode data without a fully-formed header,
22272227
* such ZSTD_f_zstd1_magicless for example.
22282228
* @return : 0, or an error code (which can be tested using ZSTD_isError()). */
2229-
ZSTDLIB_STATIC_API
22302229
ZSTD_DEPRECATED("use ZSTD_DCtx_setParameter() instead")
2230+
ZSTDLIB_STATIC_API
22312231
size_t ZSTD_DCtx_setFormat(ZSTD_DCtx* dctx, ZSTD_format_e format);
22322232

22332233
/*! ZSTD_decompressStream_simpleArgs() :
@@ -2263,8 +2263,8 @@ ZSTDLIB_STATIC_API size_t ZSTD_decompressStream_simpleArgs (
22632263
* "0" also disables frame content size field. It may be enabled in the future.
22642264
* This prototype will generate compilation warnings.
22652265
*/
2266-
ZSTDLIB_STATIC_API
22672266
ZSTD_DEPRECATED("use ZSTD_CCtx_reset, see zstd.h for detailed instructions")
2267+
ZSTDLIB_STATIC_API
22682268
size_t ZSTD_initCStream_srcSize(ZSTD_CStream* zcs,
22692269
int compressionLevel,
22702270
unsigned long long pledgedSrcSize);
@@ -2281,8 +2281,8 @@ size_t ZSTD_initCStream_srcSize(ZSTD_CStream* zcs,
22812281
* it begins with ZSTD_MAGIC_DICTIONARY, else as raw content) and ZSTD_dlm_byCopy.
22822282
* This prototype will generate compilation warnings.
22832283
*/
2284-
ZSTDLIB_STATIC_API
22852284
ZSTD_DEPRECATED("use ZSTD_CCtx_reset, see zstd.h for detailed instructions")
2285+
ZSTDLIB_STATIC_API
22862286
size_t ZSTD_initCStream_usingDict(ZSTD_CStream* zcs,
22872287
const void* dict, size_t dictSize,
22882288
int compressionLevel);
@@ -2302,8 +2302,8 @@ size_t ZSTD_initCStream_usingDict(ZSTD_CStream* zcs,
23022302
* If srcSize is not known at init time, use value ZSTD_CONTENTSIZE_UNKNOWN.
23032303
* This prototype will generate compilation warnings.
23042304
*/
2305-
ZSTDLIB_STATIC_API
23062305
ZSTD_DEPRECATED("use ZSTD_CCtx_reset, see zstd.h for detailed instructions")
2306+
ZSTDLIB_STATIC_API
23072307
size_t ZSTD_initCStream_advanced(ZSTD_CStream* zcs,
23082308
const void* dict, size_t dictSize,
23092309
ZSTD_parameters params,
@@ -2317,8 +2317,8 @@ size_t ZSTD_initCStream_advanced(ZSTD_CStream* zcs,
23172317
* note : cdict will just be referenced, and must outlive compression session
23182318
* This prototype will generate compilation warnings.
23192319
*/
2320-
ZSTDLIB_STATIC_API
23212320
ZSTD_DEPRECATED("use ZSTD_CCtx_reset and ZSTD_CCtx_refCDict, see zstd.h for detailed instructions")
2321+
ZSTDLIB_STATIC_API
23222322
size_t ZSTD_initCStream_usingCDict(ZSTD_CStream* zcs, const ZSTD_CDict* cdict);
23232323

23242324
/*! ZSTD_initCStream_usingCDict_advanced() :
@@ -2336,8 +2336,8 @@ size_t ZSTD_initCStream_usingCDict(ZSTD_CStream* zcs, const ZSTD_CDict* cdict);
23362336
* value ZSTD_CONTENTSIZE_UNKNOWN.
23372337
* This prototype will generate compilation warnings.
23382338
*/
2339-
ZSTDLIB_STATIC_API
23402339
ZSTD_DEPRECATED("use ZSTD_CCtx_reset and ZSTD_CCtx_refCDict, see zstd.h for detailed instructions")
2340+
ZSTDLIB_STATIC_API
23412341
size_t ZSTD_initCStream_usingCDict_advanced(ZSTD_CStream* zcs,
23422342
const ZSTD_CDict* cdict,
23432343
ZSTD_frameParameters fParams,
@@ -2361,8 +2361,8 @@ size_t ZSTD_initCStream_usingCDict_advanced(ZSTD_CStream* zcs,
23612361
* @return : 0, or an error code (which can be tested using ZSTD_isError())
23622362
* This prototype will generate compilation warnings.
23632363
*/
2364-
ZSTDLIB_STATIC_API
23652364
ZSTD_DEPRECATED("use ZSTD_CCtx_reset, see zstd.h for detailed instructions")
2365+
ZSTDLIB_STATIC_API
23662366
size_t ZSTD_resetCStream(ZSTD_CStream* zcs, unsigned long long pledgedSrcSize);
23672367

23682368

@@ -2474,19 +2474,19 @@ ZSTDLIB_STATIC_API size_t ZSTD_resetDStream(ZSTD_DStream* zds);
24742474
/*===== Buffer-less streaming compression functions =====*/
24752475
ZSTDLIB_STATIC_API size_t ZSTD_compressBegin(ZSTD_CCtx* cctx, int compressionLevel);
24762476
ZSTDLIB_STATIC_API size_t ZSTD_compressBegin_usingDict(ZSTD_CCtx* cctx, const void* dict, size_t dictSize, int compressionLevel);
2477-
ZSTDLIB_STATIC_API size_t ZSTD_compressBegin_usingCDict(ZSTD_CCtx* cctx, const ZSTD_CDict* cdict); /**< note: fails if cdict==NULL */
24782477
ZSTD_DEPRECATED("This function will likely be removed in the next minor release. It is misleading and has very limited utility.")
2478+
ZSTDLIB_STATIC_API size_t ZSTD_compressBegin_usingCDict(ZSTD_CCtx* cctx, const ZSTD_CDict* cdict); /**< note: fails if cdict==NULL */
24792479
ZSTDLIB_STATIC_API size_t ZSTD_copyCCtx(ZSTD_CCtx* cctx, const ZSTD_CCtx* preparedCCtx, unsigned long long pledgedSrcSize); /**< note: if pledgedSrcSize is not known, use ZSTD_CONTENTSIZE_UNKNOWN */
24802480

24812481
ZSTDLIB_STATIC_API size_t ZSTD_compressContinue(ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);
24822482
ZSTDLIB_STATIC_API size_t ZSTD_compressEnd(ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize);
24832483

24842484
/* The ZSTD_compressBegin_advanced() and ZSTD_compressBegin_usingCDict_advanced() are now DEPRECATED and will generate a compiler warning */
2485-
ZSTDLIB_STATIC_API
24862485
ZSTD_DEPRECATED("use advanced API to access custom parameters")
2487-
size_t ZSTD_compressBegin_advanced(ZSTD_CCtx* cctx, const void* dict, size_t dictSize, ZSTD_parameters params, unsigned long long pledgedSrcSize); /**< pledgedSrcSize : If srcSize is not known at init time, use ZSTD_CONTENTSIZE_UNKNOWN */
24882486
ZSTDLIB_STATIC_API
2487+
size_t ZSTD_compressBegin_advanced(ZSTD_CCtx* cctx, const void* dict, size_t dictSize, ZSTD_parameters params, unsigned long long pledgedSrcSize); /**< pledgedSrcSize : If srcSize is not known at init time, use ZSTD_CONTENTSIZE_UNKNOWN */
24892488
ZSTD_DEPRECATED("use advanced API to access custom parameters")
2489+
ZSTDLIB_STATIC_API
24902490
size_t ZSTD_compressBegin_usingCDict_advanced(ZSTD_CCtx* const cctx, const ZSTD_CDict* const cdict, ZSTD_frameParameters const fParams, unsigned long long const pledgedSrcSize); /* compression parameters are already set within cdict. pledgedSrcSize must be correct. If srcSize is not known, use macro ZSTD_CONTENTSIZE_UNKNOWN */
24912491
/**
24922492
Buffer-less streaming decompression (synchronous mode)

0 commit comments

Comments
 (0)