diff --git a/Modules/ThirdParty/NIFTI/src/nifti/znzlib/itk_znzlib_mangle.h b/Modules/ThirdParty/NIFTI/src/nifti/znzlib/itk_znzlib_mangle.h new file mode 100644 index 00000000000..295424f0f2f --- /dev/null +++ b/Modules/ThirdParty/NIFTI/src/nifti/znzlib/itk_znzlib_mangle.h @@ -0,0 +1,32 @@ +#ifndef itk_znzlib_mangle_h +#define itk_znzlib_mangle_h + +/* +This header file mangles all symbols exported from the znzlib library. +It is intended to be included by ITK's version "znzlib.h". + +It is the counterpart of itk_nifti_mangle.h: without it ITKznz exports the +plain znzlib names, which collide with any other znzlib in the same process +(e.g. a system nifti_clib pulled in by another library). + +Note: znzclose() is a macro over Xznzclose(), so only Xznzclose is mangled; +the macro expands to the mangled name at the call site. +*/ + +#define Xznzclose itk_Xznzclose +#define znzdopen itk_znzdopen +#define znzeof itk_znzeof +#define znzflush itk_znzflush +#define znzgetc itk_znzgetc +#define znzgets itk_znzgets +#define znzopen itk_znzopen +#define znzprintf itk_znzprintf +#define znzputc itk_znzputc +#define znzputs itk_znzputs +#define znzread itk_znzread +#define znzrewind itk_znzrewind +#define znzseek itk_znzseek +#define znztell itk_znztell +#define znzwrite itk_znzwrite + +#endif diff --git a/Modules/ThirdParty/NIFTI/src/nifti/znzlib/znzlib.h b/Modules/ThirdParty/NIFTI/src/nifti/znzlib/znzlib.h index fb10ed94a7b..13b9768dc66 100644 --- a/Modules/ThirdParty/NIFTI/src/nifti/znzlib/znzlib.h +++ b/Modules/ThirdParty/NIFTI/src/nifti/znzlib/znzlib.h @@ -36,6 +36,9 @@ NB: seeks for writable files with compression are quite restricted */ +// Name mangling, specific to the version of znzlib included with ITK. +#include "itk_znzlib_mangle.h" + /*=================*/ #ifdef __cplusplus extern "C" {