This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add support for building with Visual C++ 2013
authorSteve Hay <steve.m.hay@googlemail.com>
Tue, 22 Oct 2013 17:05:17 +0000 (18:05 +0100)
committerSteve Hay <steve.m.hay@googlemail.com>
Tue, 22 Oct 2013 17:12:23 +0000 (18:12 +0100)
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.

README.win32
pod/perldelta.pod
win32/Makefile
win32/makefile.mk
win32/win32.h

index 2741574..d66ff74 100644 (file)
@@ -62,10 +62,10 @@ that are also supported by perl's makefile.
 =back
 
 The Microsoft Visual C++ compilers are also now being given away free. They are
-available as "Visual C++ Toolkit 2003" or "Visual C++ 2005/2008/2010/2012 Express
+available as "Visual C++ Toolkit 2003" or "Visual C++ 2005-2013 Express
 Edition" (and also as part of the ".NET Framework SDK") and are the same
 compilers that ship with "Visual C++ .NET 2003 Professional" or "Visual C++
-2005/2008/2010/2012 Professional" respectively.
+2005-2013 Professional" respectively.
 
 This port can also be built on IA64/AMD64 using:
 
@@ -131,9 +131,9 @@ and edit win32/config.vc to change "make=nmake" into "make=dmake".  The
 latter step is only essential if you want to use dmake as your default
 make for building extensions using MakeMaker.
 
-=item Microsoft Visual C++ 2008/2010/2012 Express Edition
+=item Microsoft Visual C++ 2008-2013 Express Edition
 
-These free versions of Visual C++ 2008/2010/2012 Professional contain the same
+These free versions of Visual C++ 2008-2013 Professional contain the same
 compilers and linkers that ship with the full versions, and also contain
 everything necessary to build Perl, rather than requiring a separate download
 of the Windows SDK like previous versions did.
@@ -143,14 +143,14 @@ L<http://www.microsoft.com/downloads/search.aspx?displaylang=en>.  (Providing ex
 links to these packages has proven a pointless task because the links keep on
 changing so often.)
 
-Install Visual C++ 2008/2010/2012 Express, then setup your environment using, e.g.
+Install Visual C++ 2008-2013 Express, then setup your environment using, e.g.
 
-       C:\Program Files\Microsoft Visual Studio 11.0\Common7\Tools\vsvars32.bat
+       C:\Program Files\Microsoft Visual Studio 12.0\Common7\Tools\vsvars32.bat
 
 (assuming the default installation location was chosen).
 
 Perl should now build using the win32/Makefile.  You will need to edit that
-file to set CCTYPE to MSVC90FREE or MSVC100FREE first.
+file to set CCTYPE to one of MSVC90FREE-MSVC120FREE first.
 
 =item Microsoft Visual C++ 2005 Express Edition
 
@@ -383,6 +383,10 @@ the testsuite (many tests will be skipped).
 
 There should be no test failures.
 
+If you build with Visual C++ 2013 then two tests currently may fail with
+Daylight Saving Time related problems: F<t/io/fs.t> and
+F<cpan/HTTP-Tiny/t/110_mirror.t>.
+
 Some test failures may occur if you use a command shell other than the
 native "cmd.exe", or if you are building from a path that contains
 spaces.  So don't do that.
@@ -893,6 +897,6 @@ Win9x support was added in 5.6 (Benjamin Stuhl).
 
 Support for 64-bit Windows added in 5.8 (ActiveState Corp).
 
-Last updated: 16 September 2013
+Last updated: 22 October 2013
 
 =cut
index 26d0ac6..46f0045 100644 (file)
@@ -307,6 +307,12 @@ L</Modules and Pragmata> section.
 
 =over 4
 
+=item Windows
+
+Support for building with Visual C++ 2013 has been added.  There are currently
+two possible test failures (see L<perlwin32/"Testing Perl on Windows">) which
+will hopefully be resolved soon.
+
 =item WinCE
 
 Perl can now be built in one shot with no user intervention on WinCE by running
index 1c2eeb3..fe72408 100644 (file)
@@ -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)
index 22e63cf..9a4b9f6 100644 (file)
@@ -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
 
index 832ebda..19dcbf7 100644 (file)
@@ -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