Mercurial > jwe > octave
changeset 21032:13b9cac748f2
avoid HDF5 macros if HDF5 is not available
* oct-hdf5.h: Don't declare or define anything unless HAVE_HDF5
is defined.
* coct-hdf5-types.c, oct-hdf5-types.cc: Don't include oct-hdf5-types.h
seperately.
* coct-hdf5-types.c: Don't define HDF5 constants unless HAVE_HDF5 is
defined.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 04 Jan 2016 00:04:51 -0500 |
parents | 66a08c3cafe3 |
children | e8f2e134ee57 |
files | libinterp/corefcn/coct-hdf5-types.c libinterp/corefcn/oct-hdf5-types.cc libinterp/corefcn/oct-hdf5.h |
diffstat | 3 files changed, 8 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/coct-hdf5-types.c Sun Jan 03 14:22:08 2016 -0800 +++ b/libinterp/corefcn/coct-hdf5-types.c Mon Jan 04 00:04:51 2016 -0500 @@ -25,7 +25,6 @@ #endif #include "oct-hdf5.h" -#include "oct-hdf5-types.h" // Programming Note: This file exists so that we can hide the use // of macros and C-style casts in a C warnings about using old-style @@ -34,6 +33,10 @@ // Please do NOT eliminate this file and move code from here to // oct-hdf5-types.cc +#if defined (HAVE_HDF5) + const octave_hdf5_id octave_H5E_DEFAULT = H5E_DEFAULT; const octave_hdf5_id octave_H5P_DEFAULT = H5P_DEFAULT; const octave_hdf5_id octave_H5S_ALL = H5S_ALL; + +#endif
--- a/libinterp/corefcn/oct-hdf5-types.cc Sun Jan 03 14:22:08 2016 -0800 +++ b/libinterp/corefcn/oct-hdf5-types.cc Mon Jan 04 00:04:51 2016 -0500 @@ -26,7 +26,6 @@ #include "error.h" #include "oct-hdf5.h" -#include "oct-hdf5-types.h" bool check_hdf5_types (bool warn)
--- a/libinterp/corefcn/oct-hdf5.h Sun Jan 03 14:22:08 2016 -0800 +++ b/libinterp/corefcn/oct-hdf5.h Mon Jan 04 00:04:51 2016 -0500 @@ -23,9 +23,11 @@ #if ! defined (octave_oct_hdf5_h) #define octave_hdf5_h 1 -#if defined (HAVE_HDF5_H) +#if defined (HAVE_HDF5) +#if defined (HAVE_HDF5_H) #include <hdf5.h> +#endif #include "oct-hdf5-types.h" @@ -34,6 +36,7 @@ #else #define H5T_NATIVE_IDX H5T_NATIVE_INT #endif + #endif #endif