ess-dmsc / h5cpp

C++ wrapper for the HDF5 C-library
https://ess-dmsc.github.io/h5cpp/
GNU Lesser General Public License v2.1
118 stars 19 forks source link

ssize_t unknown in macOS clang 15.0.0 build #651

Closed amues closed 2 weeks ago

amues commented 4 months ago

Identified by @mortenjc:

In file included from (...)/h5cpp/src/h5cpp/core/iterator.cpp:26:
(...)/h5cpp/src/h5cpp/core/iterator.hpp:36:5: error: unknown type name 'ssize_t'; did you mean 'size_t'?
jkotan commented 2 weeks ago

Hi @amues, The ssize_t a type defined by POSIX so if someone use pure C it is not defined. We have a workaround for windows

#ifdef _MSC_VER
#if defined _M_IX86
    using ssize_t = int;
#elif defined _M_X64
    #include <BaseTsd.h>
    using ssize_t = SSIZE_T;
#endif
#endif

We could do a simialar tricks for non-POSIX compilers.

jkotan commented 2 weeks ago

is it fixed by https://github.com/ess-dmsc/h5cpp/commit/9486a26225b4369ebf8540bc9cce93efabe38917 ?