1
0
mirror of https://git.FreeBSD.org/src.git synced 2026-06-02 11:24:32 +00:00

Zstd: rework ZSTD_isError symbol renaming

The import of Zstd v1.5.7 in a2ac9cd606
added an unconditional renaming of ZSTD_isError to zfs_ZSTD_isError
with an asm directive.  Instead, do it with a define that is conditioned
on whether zstd_compat_wrapper.h is actually in use.  Also add a define
to that header so that it can be detected.  This allows the build to
work without using the compat wrapper.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Libby <rlibby@FreeBSD.org>
Closes #18483
This commit is contained in:
Ryan Libby
2026-05-06 09:42:54 -07:00
committed by GitHub
parent ae37f05d87
commit 872f010193
2 changed files with 8 additions and 2 deletions
@@ -33,6 +33,8 @@
* Copyright (c) 2020, Sebastian Gottschall
*/
#define _ZSTD_COMPAT_WRAPPER_H
/*
* This wrapper fixes a problem, in case the ZFS filesystem driver, is compiled
* statically into the kernel.
+6 -2
View File
@@ -9,7 +9,9 @@
* You may select, at your option, one of the above-listed licenses.
*/
#ifdef _ZSTD_COMPAT_WRAPPER_H
#undef ZSTD_isError /* defined within zstd_internal.h */
#endif
/*-*************************************
* Dependencies
@@ -34,7 +36,9 @@ const char* ZSTD_versionString(void) { return ZSTD_VERSION_STRING; }
/*! ZSTD_isError() :
* tells if a return value is an error code
* symbol is required for external callers */
unsigned ZSTD_isError(size_t code) __asm__("zfs_ZSTD_isError");
#ifdef _ZSTD_COMPAT_WRAPPER_H
#define ZSTD_isError zfs_ZSTD_isError
#endif
unsigned ZSTD_isError(size_t code) { return ERR_isError(code); }
/*! ZSTD_getErrorName() :