diff options
author | David Young <dyoung@hdfgroup.org> | 2019-11-08 18:19:31 (GMT) |
---|---|---|
committer | David Young <dyoung@hdfgroup.org> | 2019-11-08 18:19:31 (GMT) |
commit | 4981e837402428da4da061b8b815f2847cafe557 (patch) | |
tree | 1c77f2bb2457b8b9a300f18b439202f926b6cb95 /src/H5private.h | |
parent | 34eff2aae501e0276f58d2113c02d15b51fca7d8 (diff) | |
parent | 2dd5bbfe167e3e9b6b6ee657a882e24072de4aeb (diff) | |
download | hdf5-4981e837402428da4da061b8b815f2847cafe557.zip hdf5-4981e837402428da4da061b8b815f2847cafe557.tar.gz hdf5-4981e837402428da4da061b8b815f2847cafe557.tar.bz2 |
Merge remote-tracking branch 'hdf5/develop' into add-werror-and-squash-some
to pick up the NetBSD-compatibility changes that I recently merged.
Diffstat (limited to 'src/H5private.h')
-rw-r--r-- | src/H5private.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/H5private.h b/src/H5private.h index bdc6268..8cc6b30 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -345,6 +345,14 @@ #define FAIL (-1) #define UFAIL (unsigned)(-1) +/* The HDF5 library uses the symbol `ERR` frequently. So do + * header files for libraries such as curses(3), terminfo(3), etc. + * Remove its definition here to avoid clashes with HDF5. + */ +#ifdef ERR +#undef ERR +#endif + /* number of members in an array */ #ifndef NELMTS # define NELMTS(X) (sizeof(X)/sizeof(X[0])) @@ -1645,9 +1653,18 @@ extern char *strdup(const char *s); /* Assign a variable to one of a different size (think safer dst = (dsttype)src"). * The code generated by the macro checks for overflows. + * + * Use w##x##y##z instead of H5_GLUE4(w, x, y, z) because srctype + * or dsttype on some systems (e.g., NetBSD 8 and earlier) may + * supply some standard types using a macro---e.g., + * #defineĀ uint8_tĀ __uint8_t. The preprocessor will expand the + * macros before it evaluates H5_GLUE4(), and that will generate + * an unexpected name such as ASSIGN___uint8_t_TO___uint16_t. + * The preprocessor does not expand macros in w##x##y##z, so + * that will always generate the expected name. */ #define H5_CHECKED_ASSIGN(dst, dsttype, src, srctype) \ - H5_GLUE4(ASSIGN_,srctype,_TO_,dsttype)(dst,dsttype,src,srctype)\ + ASSIGN_##srctype##_TO_##dsttype(dst,dsttype,src,srctype)\ #else /* NDEBUG */ #define H5_CHECKED_ASSIGN(dst, dsttype, src, srctype) \ |