diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2022-07-11 22:48:51 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-11 22:48:51 (GMT) |
commit | af014fa61c1ffcf5a09d68e357b0190fe8ee0efa (patch) | |
tree | 2eaa1714a38e3450c2c82127b94c4a513449f548 /src/H5private.h | |
parent | dae60641036f73c64f3592317405550246464be5 (diff) | |
download | hdf5-af014fa61c1ffcf5a09d68e357b0190fe8ee0efa.zip hdf5-af014fa61c1ffcf5a09d68e357b0190fe8ee0efa.tar.gz hdf5-af014fa61c1ffcf5a09d68e357b0190fe8ee0efa.tar.bz2 |
Removes definitions for (U)LLONG_MAX and (S)SIZET_MAX (#1877)
LLONG_MAX and ULLONG_MAX are defined in limits.h in C99. SIZET_MAX
should be SIZE_MAX, which has been around forever. SSIZET_MAX should
be SSIZE_MAX, which is defined whereever ssize_t is found. I've kept
the definition for SSIZE_MAX (renamed from SSIZET_MAX) for platforms
where ssize_T is not present (e.g., Windows).
Diffstat (limited to 'src/H5private.h')
-rw-r--r-- | src/H5private.h | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/src/H5private.h b/src/H5private.h index ed15d8b..415855a 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -381,23 +381,16 @@ #endif /* - * Maximum and minimum values. These should be defined in <limits.h> for the - * most part. + * The max value for ssize_t. + * + * Only needed where ssize_t isn't a thing (e.g., Windows) */ -#ifndef LLONG_MAX -#define LLONG_MAX ((long long)(((unsigned long long)1 << (8 * sizeof(long long) - 1)) - 1)) -#define LLONG_MIN ((long long)(-LLONG_MAX) - 1) -#endif -#ifndef ULLONG_MAX -#define ULLONG_MAX ((unsigned long long)((long long)(-1))) -#endif -#ifndef SIZET_MAX -#define SIZET_MAX ((size_t)(ssize_t)(-1)) -#define SSIZET_MAX ((ssize_t)(((size_t)1 << (8 * sizeof(ssize_t) - 1)) - 1)) +#ifndef SSIZE_MAX +#define SSIZE_MAX ((ssize_t)(((size_t)1 << (8 * sizeof(ssize_t) - 1)) - 1)) #endif /* - * Maximum & minimum values for our typedefs. + * Maximum & minimum values for HDF5 typedefs. */ #define HSIZET_MAX ((hsize_t)ULLONG_MAX) #define HSSIZET_MAX ((hssize_t)LLONG_MAX) @@ -437,7 +430,7 @@ #else #define h5_posix_io_t size_t #define h5_posix_io_ret_t ssize_t -#define H5_POSIX_MAX_IO_BYTES SSIZET_MAX +#define H5_POSIX_MAX_IO_BYTES SSIZE_MAX #endif /* POSIX I/O mode used as the third parameter to open/_open |