When using clang++ with std c++14 or c++17 you would get the error "an attribute list cannot appear here" when including "lz4.h" as the visibility attribute is before the c++ attribute.
This ensures that the [[deprecated]] c++ attribute is before everything
else in the function declarations.
lz4opt is only competitive vs lz4hc level 10.
Below that level, it doesn't match the speed / compression effectiveness of regular hc parser.
This patch propose to extend lz4opt to levels 10-12.
The new level 10 tend to compress a bit better and a bit faster than previous one (mileage vary depending on file)
The only downside is that `limitedDestSize` mode is now limited to max level 9 (vs 10),
since it's only compatible with regular HC parser.
(Note : I suspect it's possible to convert lz4opt to support it too, but haven't spent time into it).
Commit 25b2435885 exported deprecated
symbols declared in lz4.h by marking all LZ4_DEPRECATED functions with
LZ4LIB_API attribute. This change does the same with functions declared
in lz4hc.h file, thus extending the export to lz4hc.h.
As result, the following 17 deprecated functions are exported again:
LZ4_compressHC
LZ4_compressHC2
LZ4_compressHC2_continue
LZ4_compressHC2_limitedOutput
LZ4_compressHC2_limitedOutput_continue
LZ4_compressHC2_limitedOutput_withStateHC
LZ4_compressHC2_withStateHC
LZ4_compressHC_continue
LZ4_compressHC_limitedOutput
LZ4_compressHC_limitedOutput_continue
LZ4_compressHC_limitedOutput_withStateHC
LZ4_compressHC_withStateHC
LZ4_createHC
LZ4_freeHC
LZ4_resetStreamStateHC
LZ4_sizeofStreamStateHC
LZ4_slideInputBufferHC
It's based on Zstandard's ZSTDLIB_API.
See also: https://github.com/Cyan4973/lz4/issues/216#issuecomment-226245432
Deprecated functions aren't LZ4LIB_API targets. Because we don't need to
export deprecated functions from now.
There are same LZ4LIB_API definitions in each header files instead of
including a common header file because LZ4_DEPRECATED is defined so.