diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/H5win32defs.h | 48 |
2 files changed, 44 insertions, 8 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3682caa..1342376 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1135,7 +1135,7 @@ if (NOT ONLY_SHARED_LIBS) add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS}) target_include_directories (${HDF5_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>" - INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" + INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>;$<BUILD_INTERFACE:${HDF5_BINARY_DIR}>" ) target_compile_options(${HDF5_LIB_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_compile_definitions(${HDF5_LIB_TARGET} @@ -1172,7 +1172,7 @@ if (BUILD_SHARED_LIBS) target_include_directories (${HDF5_LIBSH_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>" PUBLIC "$<$<BOOL:${HDF5_ENABLE_HDFS}>:${HDFS_INCLUDE_DIR}>" - INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" + INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>;$<BUILD_INTERFACE:${HDF5_BINARY_DIR}>" ) target_compile_options(${HDF5_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_compile_definitions(${HDF5_LIBSH_TARGET} diff --git a/src/H5win32defs.h b/src/H5win32defs.h index 00df56d..71162eb 100644 --- a/src/H5win32defs.h +++ b/src/H5win32defs.h @@ -20,6 +20,45 @@ * inside H5private.h * */ +#ifndef H5_HAVE_INTTYPES_H +/* The following definitions should be suitable for 64-bit Windows, which is + * LLP64, and for 32-bit Windows, which is ILP32. Those are the only + * platforms where <inttypes.h> is likely to be missing. VS2015 and later + * *may* provide these definitions. + */ +#ifdef _WIN64 +# define PRIdPTR "lld" +# define PRIoPTR "llo" +# define PRIuPTR "llu" +# define PRIxPTR "llx" +#else /* _WIN64 */ +# define PRIdPTR "ld" +# define PRIoPTR "lo" +# define PRIuPTR "lu" +# define PRIxPTR "lx" +#endif /* _WIN64 */ + +# define PRId8 "d" +# define PRIo8 "o" +# define PRIu8 "u" +# define PRIx8 "x" +# define PRId16 "d" +# define PRIo16 "o" +# define PRIu16 "u" +# define PRIx16 "x" +# define PRId32 "d" +# define PRIo32 "o" +# define PRIu32 "u" +# define PRIx32 "x" +# define PRId64 "lld" +# define PRIo64 "llo" +# define PRIu64 "llu" +# define PRIx64 "llx" +# define PRIdMAX "lld" +# define PRIoMAX "llo" +# define PRIuMAX "llu" +# define PRIxMAX "llx" +#endif /* * _MSC_VER = 1900 VS2015 @@ -41,11 +80,6 @@ typedef __int64 h5_stat_size_t; #define HDfstat(F,B) _fstati64(F,B) #define HDisatty(F) _isatty(F) -/* The isnan function needs underscore in VS2012 and earlier */ -#if (_MSC_VER <= 1700) - #define HDisnan(X) _isnan(X) -#endif /* MSC_VER < 1700 */ - #define HDgetcwd(S,Z) _getcwd(S,Z) #define HDgetdcwd(D,S,Z) _getdcwd(D,S,Z) #define HDgetdrive() _getdrive() @@ -111,8 +145,10 @@ struct timespec }; #endif /* MSC_VER < 1900 */ -/* The round functions do not exist in VS2012 and earlier */ #if (_MSC_VER <= 1700) +/* The isnan function needs underscore in VS2012 and earlier */ +#define HDisnan(X) _isnan(X) +/* The round functions do not exist in VS2012 and earlier */ #define HDllround(V) Wllround(V) #define HDllroundf(V) Wllroundf(V) #define HDlround(V) Wlround(V) |