diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2012-03-29 16:47:26 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2012-03-29 16:47:26 (GMT) |
commit | b8cb145bdfc10c7b3fcaf7a05bda4605a7d32533 (patch) | |
tree | 45cf4d20c4c02bf0d718e40b29796cecbc792b60 | |
parent | 03ee4aa0eecf1a87d0d0da2454c532a38e37a38e (diff) | |
download | hdf5-b8cb145bdfc10c7b3fcaf7a05bda4605a7d32533.zip hdf5-b8cb145bdfc10c7b3fcaf7a05bda4605a7d32533.tar.gz hdf5-b8cb145bdfc10c7b3fcaf7a05bda4605a7d32533.tar.bz2 |
[svn-r22186] MinGW compile issues fixed.
Tested: windows (big test using stdio only fails - this will be filed for further investigation)
-rwxr-xr-x | config/cmake/CTestCustom.cmake | 6 | ||||
-rw-r--r-- | config/cmake/ConfigureChecks.cmake | 16 | ||||
-rw-r--r-- | config/cmake/H5pubconf.h.in | 3 | ||||
-rw-r--r-- | config/cmake/HDFLibMacros.cmake | 63 | ||||
-rw-r--r-- | src/H5FDstdio.c | 6 | ||||
-rw-r--r-- | src/H5private.h | 2 | ||||
-rw-r--r-- | src/H5win32defs.h | 6 |
7 files changed, 73 insertions, 29 deletions
diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake index 786008f..c29cc60 100755 --- a/config/cmake/CTestCustom.cmake +++ b/config/cmake/CTestCustom.cmake @@ -2,11 +2,13 @@ SET (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 1500) SET (CTEST_CUSTOM_WARNING_EXCEPTION ${CTEST_CUSTOM_WARNING_EXCEPTION} - "H5detect.c.[0-9]+.[ \t]*:[ \t]*warning C4090" + "H5detect.c.[0-9]+.[ \t]*:[ \t]*warning C4090:" "H5detect.c.[0-9]+.[ \t]*:[ \t]*warning:[ \t]*passing argument" "H5detect.c[0-9 \t:]*warning:[ \t]*passing argument" + "H5detect.c[0-9 \t:]*note:[ \t]*expected .void .. but argument is of type .volatile" + "include/string.h[0-9 \t:]*note:[ \t]*expected .void .. but argument is of type .volatile" + "note:[ \t]*expected .void .. but argument is of type .volatile" "H5Tconv.c[0-9 \t:]*warning:[ \t]*comparison is always false due to limited range of data type" - "testhdf5.h.[0-9]+.[ \t]*:[ \t]*warning C4005" "H5Ztrans.c.[0-9]+.[ \t]*:[ \t]*warning C4244" "SZIP.src.*:[ \t]*warning" "POSIX name for this item is deprecated" diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index a2dd62e..930f3a9 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -129,6 +129,10 @@ ENDMACRO (CHECK_LIBRARY_EXISTS_CONCAT) SET (WINDOWS) IF (WIN32) + IF (MINGW) + SET (H5_HAVE_MINGW 1) + SET (WINDOWS 1) # MinGW tries to imitate Windows + ENDIF (MINGW) SET (H5_HAVE_WIN32_API 1) IF (NOT UNIX AND NOT CYGWIN AND NOT MINGW) SET (WINDOWS 1) @@ -174,7 +178,9 @@ IF (WINDOWS) SET (H5_HAVE_DIFFTIME 1) SET (H5_HAVE_LONGJMP 1) SET (H5_STDC_HEADERS 1) - SET (H5_HAVE_GETHOSTNAME 1) + IF (NOT MINGW) + SET (H5_HAVE_GETHOSTNAME 1) + ENDIF (NOT MINGW) SET (H5_HAVE_GETCONSOLESCREENBUFFERINFO 1) SET (H5_HAVE_FUNCTION 1) SET (H5_GETTIMEOFDAY_GIVES_TZ 1) @@ -302,7 +308,7 @@ IF (NOT WINDOWS) IF (HDF5_ENABLE_LARGE_FILE) SET (msg "Performing TEST_LFS_WORKS") TRY_RUN (TEST_LFS_WORKS_RUN TEST_LFS_WORKS_COMPILE - ${CMAKE_BINARY_DIR} + ${HDF5_BINARY_DIR}/CMake ${HDF5_RESOURCES_DIR}/HDF5Tests.c CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=-DTEST_LFS_WORKS OUTPUT_VARIABLE OUTPUT @@ -615,7 +621,8 @@ ENDIF (NOT WINDOWS) #----------------------------------------------------------------------------- # Check if InitOnceExecuteOnce is available #----------------------------------------------------------------------------- -IF (WINDOWS AND NOT HDF5_NO_IOEO_TEST) +IF (WINDOWS) + IF (NOT HDF5_NO_IOEO_TEST) MESSAGE (STATUS "Checking for InitOnceExecuteOnce:") IF("${H5_HAVE_IOEO}" MATCHES "^${H5_HAVE_IOEO}$") IF (LARGEFILE) @@ -673,7 +680,8 @@ IF (WINDOWS AND NOT HDF5_NO_IOEO_TEST) "Return value: ${HAVE_IOEO_EXITCODE}\n") ENDIF("${HAVE_IOEO_EXITCODE}" EQUAL 0) ENDIF("${H5_HAVE_IOEO}" MATCHES "^${H5_HAVE_IOEO}$") -ENDIF (WINDOWS AND NOT HDF5_NO_IOEO_TEST) + ENDIF (NOT HDF5_NO_IOEO_TEST) +ENDIF (WINDOWS) #----------------------------------------------------------------------------- diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index 70c6e50..a87efd1 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -6,6 +6,9 @@ /* Define if the Windows virtual file driver should be compiled */ #cmakedefine H5_HAVE_WINDOWS @H5_HAVE_WINDOWS@ +/* Define if using MinGW */ +#cmakedefine H5_HAVE_MINGW @H5_HAVE_MINGW@ + /* Define if on the Windows platform and default WIN32 API */ #cmakedefine H5_HAVE_WIN32_API @H5_HAVE_WIN32_API@ diff --git a/config/cmake/HDFLibMacros.cmake b/config/cmake/HDFLibMacros.cmake index 23c81da..dcf911b 100644 --- a/config/cmake/HDFLibMacros.cmake +++ b/config/cmake/HDFLibMacros.cmake @@ -51,12 +51,19 @@ MACRO (EXTERNAL_JPEG_LIBRARY compress_type libtype jpeg_pic) ADD_DEPENDENCIES (jpeg JPEG) IF (${libtype} MATCHES "SHARED") - IF (WIN32 AND NOT MINGW) - SET_TARGET_PROPERTIES(jpeg PROPERTIES - IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" - IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" - ) - ELSE (WIN32 AND NOT MINGW) + IF (WIN32) + IF (MINGW) + SET_TARGET_PROPERTIES(jpeg PROPERTIES + IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${JPEG_LIB_NAME}.lib" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${JPEG_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + ) + ELSE (MINGW) + SET_TARGET_PROPERTIES(jpeg PROPERTIES + IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + ) + ENDIF (MINGW) + ELSE (WIN32) IF (CYGWIN) SET_TARGET_PROPERTIES(jpeg PROPERTIES IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" @@ -69,7 +76,7 @@ MACRO (EXTERNAL_JPEG_LIBRARY compress_type libtype jpeg_pic) SOVERSION "${JPEG_VERSION_STRING}" ) ENDIF (CYGWIN) - ENDIF (WIN32 AND NOT MINGW) + ENDIF (WIN32) ELSE (${libtype} MATCHES "SHARED") IF (WIN32 AND NOT MINGW) SET_TARGET_PROPERTIES(jpeg PROPERTIES @@ -158,12 +165,19 @@ MACRO (EXTERNAL_SZIP_LIBRARY compress_type libtype encoding) ADD_DEPENDENCIES (szip SZIP) IF (${libtype} MATCHES "SHARED") - IF (WIN32 AND NOT MINGW) - SET_TARGET_PROPERTIES(szip PROPERTIES - IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" - IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" - ) - ELSE (WIN32 AND NOT MINGW) + IF (WIN32) + IF (MINGW) + SET_TARGET_PROPERTIES(szip PROPERTIES + IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${SZIP_LIB_NAME}.lib" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${SZIP_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + ) + ELSE (MINGW) + SET_TARGET_PROPERTIES(szip PROPERTIES + IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + ) + ENDIF (MINGW) + ELSE (WIN32) IF (CYGWIN) SET_TARGET_PROPERTIES(szip PROPERTIES IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" @@ -176,7 +190,7 @@ MACRO (EXTERNAL_SZIP_LIBRARY compress_type libtype encoding) SOVERSION "${SZIP_VERSION_STRING}" ) ENDIF (CYGWIN) - ENDIF (WIN32 AND NOT MINGW) + ENDIF (WIN32) ELSE (${libtype} MATCHES "SHARED") IF (WIN32 AND NOT MINGW) SET_TARGET_PROPERTIES(szip PROPERTIES @@ -267,12 +281,19 @@ MACRO (EXTERNAL_ZLIB_LIBRARY compress_type libtype) ADD_DEPENDENCIES (zlib ZLIB) IF (${libtype} MATCHES "SHARED") - IF (WIN32 AND NOT MINGW) - SET_TARGET_PROPERTIES(zlib PROPERTIES - IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" - IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" - ) - ELSE (WIN32 AND NOT MINGW) + IF (WIN32) + IF (MINGW) + SET_TARGET_PROPERTIES(zlib PROPERTIES + IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${ZLIB_LIB_NAME}.lib" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${ZLIB_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + ) + ELSE (MINGW) + SET_TARGET_PROPERTIES(zlib PROPERTIES + IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + ) + ENDIF (MINGW) + ELSE (WIN32) IF (CYGWIN) SET_TARGET_PROPERTIES(zlib PROPERTIES IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" @@ -285,7 +306,7 @@ MACRO (EXTERNAL_ZLIB_LIBRARY compress_type libtype) SOVERSION "${ZLIB_VERSION_STRING}" ) ENDIF (CYGWIN) - ENDIF (WIN32 AND NOT MINGW) + ENDIF (WIN32) ELSE (${libtype} MATCHES "SHARED") IF (WIN32 AND NOT MINGW) SET_TARGET_PROPERTIES(zlib PROPERTIES diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index 8e970c6..647836f 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -44,6 +44,10 @@ #endif #ifdef H5_HAVE_WIN32_API +/* The following two defines must be before any windows headers are included */ +#define WIN32_LEAN_AND_MEAN /* Exclude rarely-used stuff from Windows headers */ +#define NOGDI /* Exclude Graphic Display Interface macros */ + #include <windows.h> #include <io.h> @@ -115,10 +119,12 @@ typedef struct H5FD_stdio_t { /* Use similar structure as in H5private.h by defining Windows stuff first. */ #ifdef H5_HAVE_WIN32_API + #ifndef H5_HAVE_MINGW # define file_fseek _fseeki64 # define file_offset_t __int64 # define file_ftruncate _chsize_s /* Supported in VS 2005 or newer */ # define file_ftell _ftelli64 + #endif #endif /* Use file_xxx to indicate these are local macros, avoiding confusing diff --git a/src/H5private.h b/src/H5private.h index 5bdd8ed..7d67dec 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -151,7 +151,9 @@ #ifdef H5_HAVE_WIN32_API +/* The following two defines must be before any windows headers are included */ #define WIN32_LEAN_AND_MEAN /* Exclude rarely-used stuff from Windows headers */ +#define NOGDI /* Exclude Graphic Display Interface macros */ #ifdef H5_HAVE_WINSOCK_H #include <winsock2.h> diff --git a/src/H5win32defs.h b/src/H5win32defs.h index 5f886d1..e9b87625 100644 --- a/src/H5win32defs.h +++ b/src/H5win32defs.h @@ -33,9 +33,7 @@ typedef __int64 h5_stat_size_t; #define HDdup(F) _dup(F) #define HDfdopen(N,S) _fdopen(N,S) #define HDfileno(F) _fileno(F) -#define HDfseek(F,O,W) _fseeki64(F,O,W) #define HDfstat(F,B) _fstati64(F,B) -#define HDftruncate(F,L) _chsize_s(F,L) #define HDisatty(F) _isatty(F) #define HDgetcwd(S,Z) _getcwd(S,Z) #define HDgetdcwd(D,S,Z) _getdcwd(D,S,Z) @@ -91,4 +89,8 @@ struct timezone { * type cannot be cast as a ulong like other systems. */ #define HDpthread_self_ulong() ((unsigned long)GetCurrentThreadId()) +#ifndef H5_HAVE_MINGW +#define HDftruncate(F,L) _chsize_s(F,L) +#define HDfseek(F,O,W) _fseeki64(F,O,W) +#endif #endif /* H5_HAVE_WIN32_API */ |