MathisRosenhauer / libaec

libaec - Adaptive Entropy Coding library
https://gitlab.dkrz.de/k202009/libaec
BSD 2-Clause "Simplified" License
12 stars 9 forks source link

libaec.h and compile definitions #30

Closed jwsblokland closed 5 months ago

jwsblokland commented 10 months ago

Hello,

A moment ago, I compiled HDF5 with support for libaec using CMake and I noticed several warning related to libaec regarding the compile definition BUILDING_LIBAEC and HAVE_VISIBILITY in the header file libaec.h:

#if BUILDING_LIBAEC && HAVE_VISIBILITY
#  define LIBAEC_DLL_EXPORTED __attribute__((__visibility__("default")))
#else
#  define LIBAEC_DLL_EXPORTED
#endif

These defines are not defined in the CMake config libaec-config.cmake resulting in a warning message. It would be better if these defines are been added to the config file. Now looking at it, would it be an option to replace #if by #ifdef. If that is possible no modification of the CMake config file is needed.

MathisRosenhauer commented 10 months ago

Thanks for reporting this. I have to keep the #if for HAVE_VISIBILITY but that should now never be evaluated if BUILDING_LIBAEC is undefined.

jwsblokland commented 10 months ago

No problem. Your solution looks good to me. Thanks for solving it so quickly.