diff --git a/cmake_config.h.in b/cmake_config.h.in index a9774af0c..43f387ec1 100644 --- a/cmake_config.h.in +++ b/cmake_config.h.in @@ -13,27 +13,28 @@ #define open _open #define close _close #define read _read + #ifdef _WIN64 #define lseek _lseeki64 #else #define lseek _lseek #endif - - #define strdup _strdup #define fdopen _fdopen #define write _write #define snprintf _snprintf - #ifndef strcasecmp - //#define strcasecmp stricmp - #define strcasecmp _stricmp - #define snprintf _snprintf - #endif - #define strtoll _strtoi64 #endif +#if defined(_WIN32) + #ifndef strcasecmp + #define strcasecmp _stricmp + #define snprintf _snprintf + #endif +#endif + + /* Cache Size, other variables for HDF5 */ #define DEFAULT_CHUNK_SIZE ${DEFAULT_CHUNK_SIZE} diff --git a/configure.ac b/configure.ac index 8e5c3e510..b29c8f65c 100644 --- a/configure.ac +++ b/configure.ac @@ -854,6 +854,15 @@ AC_SUBST(HAS_PNETCDF,[$enable_pnetcdf]) AC_SUBST(HAS_HDF5,[$enable_netcdf_4]) AC_SUBST(HAS_SZLIB,[$nc_has_szlib]) +# Include some specifics for netcdf on windows. +#AH_VERBATIM([_WIN32_STRICMP], +AH_BOTTOM( +[/* Define strcasecmp, snprintf on Win32 systems. */ +#ifdef _WIN32 + #define strcasecmp _stricmp + #define snprintf _snprintf +#endif]) + # Access netcdf specific version of config.h AH_BOTTOM([#include "ncconfigure.h"])