summaryrefslogtreecommitdiffstats
path: root/src/H5private.h
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2019-11-05 21:36:09 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2019-11-05 21:36:09 (GMT)
commit2dd5bbfe167e3e9b6b6ee657a882e24072de4aeb (patch)
treeb4605ad55c3c2b82218a915fc2322d0f75a4f880 /src/H5private.h
parentafd4b291315e39e3966eadaf8ae9894b30e9504e (diff)
parent0b721858e46a317c370a24115032d5be41688f67 (diff)
downloadhdf5-2dd5bbfe167e3e9b6b6ee657a882e24072de4aeb.zip
hdf5-2dd5bbfe167e3e9b6b6ee657a882e24072de4aeb.tar.gz
hdf5-2dd5bbfe167e3e9b6b6ee657a882e24072de4aeb.tar.bz2
Merge pull request #1984 in HDFFV/hdf5 from ~DYOUNG/netbsd:develop to develop
* commit '0b721858e46a317c370a24115032d5be41688f67': Make these scripts relocatable again: derive a relative path for the original installation prefix from the examples prefix. Use that relative path to locate the current installation prefix, always. Fall back to an absolute installation prefix if the relative path cannot be derived. Get the path to prefix right: needs a ../ to back out of subdirectory c/. Make this script relocatable again: derive a relative path for the original installation prefix from the examples prefix. Use that relative path to locate the current installation prefix, always. Fall back to an absolute installation prefix if the relative path cannot be derived. Let us override the examples directory using --with-examplesdir=DIR. This is handy for NetBSD where HDF5 examples are installed by convention in $prefix/share/examples/hdf5/ rather than in ${prefix}/share/hdf5_examples/, which is the HDF5 default. Follow longstanding execv convention for compatibility with NetBSD. Under the examples directories, always find the installed HDF5 executables and scripts using @prefix@ instead of a relative path, because the number of ../ in the relative path will be different on NetBSD than on other systems. Make the HDF5 configure script grok NetBSD. For portability, insulate the HDF5 library from some system macros. Not every system has perl installed in /usr/bin/, so change the shebang (#!) line to `/usr/bin/env perl` to locate perl on the PATH. For portability, use the POSIX sh(1) string-comparison operator `=` instead of `==`.
Diffstat (limited to 'src/H5private.h')
-rw-r--r--src/H5private.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/H5private.h b/src/H5private.h
index 0bfc91b..b5ee984 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) \