diff options
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/src/multiarray/datetime_strings.c | 19 | ||||
-rw-r--r-- | numpy/distutils/mingw32ccompiler.py | 4 |
2 files changed, 22 insertions, 1 deletions
diff --git a/numpy/core/src/multiarray/datetime_strings.c b/numpy/core/src/multiarray/datetime_strings.c index 7b236d202..3a3243c27 100644 --- a/numpy/core/src/multiarray/datetime_strings.c +++ b/numpy/core/src/multiarray/datetime_strings.c @@ -14,7 +14,8 @@ #if defined(_WIN32) && \ defined(__GNUC__) && \ - defined(NPY_MINGW_USE_CUSTOM_MSVCR) + (defined(NPY_MINGW_USE_CUSTOM_MSVCR) | \ + defined(NPY_MINGW_USE_64BIT_MSVCR)) #define time_t __time64_t #endif @@ -54,6 +55,14 @@ get_localtime(NPY_TIME_T *ts, struct tm *tms) func_name = "_localtime64_s"; goto fail; } + #elif defined(__GNUC__) && defined(NPY_MINGW_USE_64BIT_MSVCR) + struct tm *tms_tmp; + tms_tmp = _localtime64(ts); + if (tms_tmp == NULL) { + func_name = "_localtime64"; + goto fail; + } + memcpy((void*)tms, (void*)tms_tmp, sizeof(struct tm)); #else struct tm *tms_tmp; tms_tmp = localtime(ts); @@ -99,6 +108,14 @@ get_gmtime(NPY_TIME_T *ts, struct tm *tms) func_name = "_gmtime64_s"; goto fail; } + #elif defined(__GNUC__) && defined(NPY_MINGW_USE_64BIT_MSVCR) + struct tm *tms_tmp; + tms_tmp = _gmtime64(ts); + if (tms_tmp == NULL) { + func_name = "_gmtime64"; + goto fail; + } + memcpy((void*)tms, (void*)tms_tmp, sizeof(struct tm)); #else struct tm *tms_tmp; tms_tmp = gmtime(ts); diff --git a/numpy/distutils/mingw32ccompiler.py b/numpy/distutils/mingw32ccompiler.py index 68625c6b3..3e32c6362 100644 --- a/numpy/distutils/mingw32ccompiler.py +++ b/numpy/distutils/mingw32ccompiler.py @@ -94,6 +94,10 @@ class Mingw32CCompiler(distutils.cygwinccompiler.CygwinCCompiler): if build_msvcr_library() | build_msvcr_library(debug=True): # add preprocessor statement for using customized msvcr lib self.define_macro('NPY_MINGW_USE_CUSTOM_MSVCR') + # Else do a check if the current runtime version is >= VS2005 + elif int(msvc_runtime_library().lstrip('msvcr')) >= 80: + # add preprocessor statement to use 64-bit fallback + self.define_macro('NPY_MINGW_USE_64BIT_MSVCR') # **changes: eric jones 4/11/01 # 2. increased optimization and turned off all warnings |