summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2020-08-24 17:36:07 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2020-08-24 17:36:07 (GMT)
commitcfa206696c93b906ecfd318c8d09d997586d213b (patch)
tree31f0c9a659404711180dcf7baae54a9d9aa9b9ff /src
parentcfbe781abd157357d14c850e5beb26f1f4bbfab2 (diff)
downloadhdf5-cfa206696c93b906ecfd318c8d09d997586d213b.zip
hdf5-cfa206696c93b906ecfd318c8d09d997586d213b.tar.gz
hdf5-cfa206696c93b906ecfd318c8d09d997586d213b.tar.bz2
Fixes issues with HDFS VFD.
- Warning from hdfs.h interpreted as an error under gcc - Incorrect order of headers results inn incorrect initialization - <hdfs.h> not "hdfs.h" - Other misc tidying
Diffstat (limited to 'src')
-rw-r--r--src/H5FDhdfs.c25
-rw-r--r--src/H5FDhdfs.h8
2 files changed, 22 insertions, 11 deletions
diff --git a/src/H5FDhdfs.c b/src/H5FDhdfs.c
index 29d032e..b4f70c9 100644
--- a/src/H5FDhdfs.c
+++ b/src/H5FDhdfs.c
@@ -20,6 +20,9 @@
* File System (HDFS).
*/
+/* This source code file is part of the H5FD driver module */
+#include "H5FDdrvr_module.h"
+
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
#include "H5FDprivate.h" /* File drivers */
@@ -30,11 +33,19 @@
#ifdef H5_HAVE_LIBHDFS
-/* This source code file is part of the H5FD driver module */
-#include "H5FDdrvr_module.h"
-
-/* HDFS routines */
-#include "hdfs.h"
+/* HDFS routines
+ * Have to turn off -Wstrict-prototypes as this header contains functions
+ * defined as foo() instead of foo(void), which triggers warnings that HDF5
+ * then interprets as errors.
+ * -Wundef isn't interpreted as an error by HDF5, but the header does do
+ * some bad symbol interpretation that raises a warning that is out of our
+ * control.
+ */
+H5_GCC_DIAG_OFF(strict-prototypes)
+H5_GCC_DIAG_OFF(undef)
+#include <hdfs.h>
+H5_GCC_DIAG_ON(strict-prototypes)
+H5_GCC_DIAG_ON(undef)
/* toggle function call prints: 1 turns on */
#define HDFS_DEBUG 0
@@ -369,12 +380,12 @@ done:
hid_t
H5FD_hdfs_init(void)
{
- hid_t ret_value = H5I_INVALID_HID; /* Return value */
#if HDFS_STATS
unsigned int bin_i;
#endif
+ hid_t ret_value = H5I_INVALID_HID; /* Return value */
- FUNC_ENTER_NOAPI(FAIL)
+ FUNC_ENTER_NOAPI(H5I_INVALID_HID)
#if HDFS_DEBUG
HDfprintf(stdout, "called %s.\n", FUNC);
diff --git a/src/H5FDhdfs.h b/src/H5FDhdfs.h
index d67ab9e..e195550 100644
--- a/src/H5FDhdfs.h
+++ b/src/H5FDhdfs.h
@@ -29,10 +29,6 @@
#endif /* H5_HAVE_LIBHDFS */
#ifdef H5_HAVE_LIBHDFS
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/****************************************************************************
*
* Structure: H5FD_hdfs_fapl_t
@@ -112,6 +108,10 @@ typedef struct H5FD_hdfs_fapl_t {
int32_t stream_buffer_size;
} H5FD_hdfs_fapl_t;
+#ifdef __cplusplus
+extern "C" {
+#endif
+
H5_DLL hid_t H5FD_hdfs_init(void);
H5_DLL herr_t H5Pget_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa_out);
H5_DLL herr_t H5Pset_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa);