diff options
author | Steve Hay <steve.m.hay@googlemail.com> | 2013-10-22 18:05:17 +0100 |
---|---|---|
committer | Steve Hay <steve.m.hay@googlemail.com> | 2013-10-22 18:12:23 +0100 |
commit | 3e7c2d43f6ca98041fe070aeb1caf1177867ca3c (patch) | |
tree | 45b7fcd665cd93491c2b89799e8fc7603d8b9409 /win32 | |
parent | 46879fadd034dcb5d6f720076845767f8ccf152d (diff) | |
download | perl-3e7c2d43f6ca98041fe070aeb1caf1177867ca3c.tar.gz |
Add support for building with Visual C++ 2013
Two tests (t/io/fs.t and cpan/HTTP-Tiny/t/110_mirror.t) fail on my system,
currently in Daylight Saving Time, both due to times written/read by
utime()/stat() being off by one hour...
Not sure what the issue is yet, but I've reproduced it in this C program:
#include <stdio.h>
#include <sys/stat.h>
#include <sys/utime.h>
void main(void) {
struct _utimbuf ut;
struct _stat st;
time_t t;
t = 760060800;
printf("Setting: %ld\n", t);
ut.actime = t;
ut.modtime = t;
if (_utime("test.c", &ut) == -1) {
perror("_utime failed\n");
return;
}
if (_stat("test.c", &st) != 0) {
perror("_stat failed\n");
return;
}
printf(" atime: %ld\n", st.st_atime);
printf(" mtime: %ld\n", st.st_mtime);
}
which outputs
Setting: 760060800
atime: 760057200
mtime: 760057200
with VC++ 2013, instead of
Setting: 760060800
atime: 760060800
mtime: 760060800
like Visual C++ 6.0 through 2012 all do.
Diffstat (limited to 'win32')
-rw-r--r-- | win32/Makefile | 4 | ||||
-rw-r--r-- | win32/makefile.mk | 4 | ||||
-rw-r--r-- | win32/win32.h | 4 |
3 files changed, 11 insertions, 1 deletions
diff --git a/win32/Makefile b/win32/Makefile index 1c2eeb3265..fe7240812e 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -126,6 +126,10 @@ CCTYPE = MSVC60 #CCTYPE = MSVC110 # Visual C++ 2012 Express Edition (aka Visual C++ 11.x) (free version) #CCTYPE = MSVC110FREE +# Visual C++ 2013 (aka Visual C++ 12.x) (full version) +#CCTYPE = MSVC120 +# Visual C++ 2013 Express Edition (aka Visual C++ 12.x) (free version) +#CCTYPE = MSVC120FREE # # uncomment next line if you want debug version of perl (big,slow) diff --git a/win32/makefile.mk b/win32/makefile.mk index 22e63cff25..9a4b9f6f1c 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -132,6 +132,10 @@ USE_LARGE_FILES *= define #CCTYPE = MSVC110 # Visual C++ 2012 Express Edition (aka Visual C++ 11.x) (free version) #CCTYPE = MSVC110FREE +# Visual C++ 2013 (aka Visual C++ 12.x) (full version) +#CCTYPE = MSVC120 +# Visual C++ 2013 Express Edition (aka Visual C++ 12.x) (free version) +#CCTYPE = MSVC120FREE # MinGW or mingw-w64 with gcc-3.2 or later CCTYPE *= GCC diff --git a/win32/win32.h b/win32/win32.h index 832ebda866..19dcbf7540 100644 --- a/win32/win32.h +++ b/win32/win32.h @@ -242,7 +242,9 @@ typedef unsigned short mode_t; #pragma warning(disable: 4102) /* "unreferenced label" */ -#define isnan _isnan +#if _MSC_VER < 1800 +#define isnan _isnan /* Defined already in VC++ 12.0 */ +#endif #ifdef UNDER_CE /* revisit what function this becomes celib vs corelibc, prv warning here*/ # undef snprintf #endif |