From 6b4d8ccd04c53a2c093d68e7b3e75671b15cf567 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 23 Jun 2021 14:14:51 -0700 Subject: [PATCH 1/2] Reorganization of C and POSIX headers in H5public.h & H5private.h Consolidated and removed duplicates --- src/H5private.h | 3 --- src/H5public.h | 23 ++++++++++------------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/src/H5private.h b/src/H5private.h index ce6681ab864..9df765fe76a 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -31,10 +31,8 @@ #include #include #include -#include #include #include -#include #include #include #include @@ -43,7 +41,6 @@ #ifdef H5_HAVE_UNISTD_H #include #include -#include #include #endif diff --git a/src/H5public.h b/src/H5public.h index cef15d94455..b6c823ab74a 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -35,22 +35,20 @@ #include /* For setting POSIX, BSD, etc. compatibility */ #endif -#ifdef H5_HAVE_SYS_TYPES_H -#include -#endif - -#include /* For H5T_NATIVE_CHAR defn in H5Tpublic.h */ -#include /* For variadic functions in H5VLpublic.h */ - -#include /* For C9x types */ - +/* C library header files for things that appear in HDF5 public headers */ #ifdef __cplusplus #define __STDC_FORMAT_MACROS #endif -#include /* C99/POSIX.1 header for uint64_t, PRIu64 */ - -#ifdef H5_HAVE_STDDEF_H +#include +#include +#include +#include #include +#include + +/* POSIX headers */ +#ifdef H5_HAVE_UNISTD_H +#include #endif #ifdef H5_HAVE_PARALLEL @@ -192,7 +190,6 @@ typedef int herr_t; * } * \endcode */ -#include typedef bool hbool_t; typedef int htri_t; From ad973b369ec2ed71a6efe00b0041decde6bff158 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 23 Jun 2021 14:48:39 -0700 Subject: [PATCH 2/2] It turns out Windows has sys/types.h --- src/H5public.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/H5public.h b/src/H5public.h index b6c823ab74a..e192de09d42 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -46,8 +46,11 @@ #include #include -/* POSIX headers */ -#ifdef H5_HAVE_UNISTD_H +/* Unlike most sys/ headers, which are POSIX-only, sys/types.h is avaible + * on Windows, though it doesn't necessarily contain all the POSIX types + * we need for HDF5 (e.g. ssize_t). + */ +#ifdef H5_HAVE_SYS_TYPES_H #include #endif