Skip to content

Commit 3197b6d

Browse files
authored
Merge pull request InsightSoftwareConsortium#5799 from blowekamp/fix_hdf5_mingw
Fix compilation issue with HDF5 and mingw.
2 parents cc7ffb9 + 207a73e commit 3197b6d

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

Modules/ThirdParty/HDF5/src/CMakeLists.txt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,6 @@ set(
191191
CACHE INTERNAL
192192
"Enable support for non-standard programming language features"
193193
)
194-
set(
195-
HDF5_ENABLE_NONSTANDARD_FEATURE_FLOAT16
196-
ON
197-
CACHE INTERNAL
198-
"Enable support for _Float16 C datatype"
199-
)
200194
set(
201195
HDF5_ENABLE_SUBFILING_VFD
202196
OFF
@@ -225,6 +219,11 @@ set(
225219
CACHE INTERNAL
226220
"Enable v1.14 API (v16, v18, v110, v112, v114)"
227221
)
222+
if(MINGW)
223+
# vasprintf detection is unreliable on Windows/MinGW - hard-coded to 0
224+
# See: https://github.com/HDFGroup/hdf5/issues/5885
225+
set(H5_HAVE_VASPRINTF 0)
226+
endif()
228227

229228
if(NOT BUILD_SHARED_LIBS)
230229
set(BUILD_STATIC_LIBS ON CACHE INTERNAL "Build Static Libraries")

Modules/ThirdParty/HDF5/src/itkhdf5/src/H5private.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020
#ifndef H5private_H
2121
#define H5private_H
2222

23+
/* Define __STDC_WANT_IEC_60559_TYPES_EXT__ for _FloatN support, if available.
24+
* Do that before including any other headers in case they include <float.h>
25+
* implicitly. */
26+
#define __STDC_WANT_IEC_60559_TYPES_EXT__
27+
2328
#include "H5public.h" /* Include Public Definitions */
2429

2530
#include <assert.h>
@@ -33,9 +38,6 @@
3338
#include <stdlib.h>
3439
#include <string.h>
3540
#include <time.h>
36-
37-
/* Define __STDC_WANT_IEC_60559_TYPES_EXT__ for _FloatN support, if available */
38-
#define __STDC_WANT_IEC_60559_TYPES_EXT__
3941
#include <float.h>
4042
#include <math.h>
4143

0 commit comments

Comments
 (0)