update Time-HiRes to CPAN version 1.9722
authorZefram <zefram@fysh.org>
Wed, 18 May 2011 20:49:45 +0000 (21:49 +0100)
committerZefram <zefram@fysh.org>
Wed, 18 May 2011 21:31:50 +0000 (22:31 +0100)
- Fix broken linkage on Windows with gcc 3.4 seen with ActivePerl,
  report from Christian Walde [rt.cpan.org #61648], fix derived
  from Vincent Pit.
- Jump through hoops to avoid compiler warnings.

Porting/Maintainers.pl
cpan/Time-HiRes/Changes
cpan/Time-HiRes/HiRes.pm
cpan/Time-HiRes/HiRes.xs
cpan/Time-HiRes/Makefile.PL
pod/perldelta.pod

index a91ee95..446db49 100755 (executable)
@@ -1917,9 +1917,9 @@ use File::Glob qw(:case);
     'Time::HiRes' =>
        {
        'MAINTAINER'    => 'zefram',
-       'DISTRIBUTION'  => 'JHI/Time-HiRes-1.9721.tar.gz',
+       'DISTRIBUTION'  => 'ZEFRAM/Time-HiRes-1.9722.tar.gz',
        'FILES'         => q[cpan/Time-HiRes],
-       'UPSTREAM'      => undef,
+       'UPSTREAM'      => 'cpan',
        },
 
     'Time::Local' =>
index c365e99..0515b8f 100644 (file)
@@ -1,5 +1,14 @@
 Revision history for the Perl extension Time::HiRes.
 
+1.9722 [2011-05-18]
+       - Update for changes in build process in the core, patches
+         from BinGOs [rt.cpan.org #58858] and Craig Berry [rt.cpan.org
+         #63363].
+       - Fix broken linkage on Windows with gcc 3.4 seen with ActivePerl,
+         report from Christian Walde [rt.cpan.org #61648], fix derived
+         from Vincent Pit.
+       - Jump through hoops to avoid compiler warnings.
+
 1.9721 [2010-03-17]
        - Address [rt.cpan.org #54196] alarm and ularm return values are bogus,
          additional fix from Gisle Aas
index 8f2ec21..e6295a8 100644 (file)
@@ -23,7 +23,7 @@ require DynaLoader;
                 stat
                );
 
-$VERSION = '1.9721_01';
+$VERSION = '1.9722';
 $XS_VERSION = $VERSION;
 $VERSION = eval $VERSION;
 
@@ -585,6 +585,8 @@ Copyright (c) 1996-2002 Douglas E. Wegscheid.  All rights reserved.
 Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Jarkko Hietaniemi.
 All rights reserved.
 
+Copyright (C) 2011 Andrew Main (Zefram) <zefram@fysh.org>
+
 This program is free software; you can redistribute it and/or modify
 it under the same terms as Perl itself.
 
index 1dc2a68..970baa1 100644 (file)
@@ -4,6 +4,8 @@
  * 
  * Copyright (c) 2002-2010 Jarkko Hietaniemi.
  * All rights reserved.
+ *
+ * Copyright (C) 2011 Andrew Main (Zefram) <zefram@fysh.org>
  * 
  * This program is free software; you can redistribute it and/or modify
  * it under the same terms as Perl itself.
@@ -716,39 +718,34 @@ myNVtime()
 #endif /* #ifdef HAS_GETTIMEOFDAY */
 
 static void
-hrstatns(UV atime, UV mtime, UV ctime, UV *atime_nsec, UV *mtime_nsec, UV *ctime_nsec)
+hrstatns(UV *atime_nsec, UV *mtime_nsec, UV *ctime_nsec)
 {
   dTHXR;
-  *atime_nsec = 0;
-  *mtime_nsec = 0;
-  *ctime_nsec = 0;
-#ifdef TIME_HIRES_STAT
 #if TIME_HIRES_STAT == 1
   *atime_nsec = PL_statcache.st_atimespec.tv_nsec;
   *mtime_nsec = PL_statcache.st_mtimespec.tv_nsec;
   *ctime_nsec = PL_statcache.st_ctimespec.tv_nsec;
-#endif
-#if TIME_HIRES_STAT == 2
+#elif TIME_HIRES_STAT == 2
   *atime_nsec = PL_statcache.st_atimensec;
   *mtime_nsec = PL_statcache.st_mtimensec;
   *ctime_nsec = PL_statcache.st_ctimensec;
-#endif
-#if TIME_HIRES_STAT == 3
+#elif TIME_HIRES_STAT == 3
   *atime_nsec = PL_statcache.st_atime_n;
   *mtime_nsec = PL_statcache.st_mtime_n;
   *ctime_nsec = PL_statcache.st_ctime_n;
-#endif
-#if TIME_HIRES_STAT == 4
+#elif TIME_HIRES_STAT == 4
   *atime_nsec = PL_statcache.st_atim.tv_nsec;
   *mtime_nsec = PL_statcache.st_mtim.tv_nsec;
   *ctime_nsec = PL_statcache.st_ctim.tv_nsec;
-#endif
-#if TIME_HIRES_STAT == 5
+#elif TIME_HIRES_STAT == 5
   *atime_nsec = PL_statcache.st_uatime * 1000;
   *mtime_nsec = PL_statcache.st_umtime * 1000;
   *ctime_nsec = PL_statcache.st_uctime * 1000;
-#endif
-#endif
+#else /* !TIME_HIRES_STAT */
+  *atime_nsec = 0;
+  *mtime_nsec = 0;
+  *ctime_nsec = 0;
+#endif /* !TIME_HIRES_STAT */
 }
 
 #include "const-c.inc"
@@ -765,8 +762,10 @@ BOOT:
 #ifdef ATLEASTFIVEOHOHFIVE
 #   ifdef HAS_GETTIMEOFDAY
   {
-    hv_store(PL_modglobal, "Time::NVtime", 12, newSViv(PTR2IV(myNVtime)), 0);
-    hv_store(PL_modglobal, "Time::U2time", 12, newSViv(PTR2IV(myU2time)), 0);
+    (void) hv_store(PL_modglobal, "Time::NVtime", 12,
+               newSViv(PTR2IV(myNVtime)), 0);
+    (void) hv_store(PL_modglobal, "Time::U2time", 12,
+               newSViv(PTR2IV(myU2time)), 0);
   }
 #   endif
 #endif
@@ -1248,8 +1247,7 @@ PROTOTYPE: ;$
          UV atime_nsec;
          UV mtime_nsec;
          UV ctime_nsec;
-         hrstatns(atime, mtime, ctime,
-                  &atime_nsec, &mtime_nsec, &ctime_nsec);
+         hrstatns(&atime_nsec, &mtime_nsec, &ctime_nsec);
          if (atime_nsec)
            ST( 8) = sv_2mortal(newSVnv(atime + 1e-9 * (NV) atime_nsec));
          if (mtime_nsec)
index 9436f0c..7766f29 100644 (file)
@@ -768,6 +768,27 @@ sub doMakefile {
         realclean => { FILES=> 'const-c.inc const-xs.inc' },
     );
 
+    if ($^O eq "MSWin32" && !(grep { /\ALD[A-Z]*=/ } @ARGV)) {
+       my $libperl = $Config{libperl} || "";
+       my $gccversion = $Config{gccversion} || "";
+       if ($gccversion =~ /\A3\.4\.[0-9]+/ and $libperl =~ /\.lib\z/) {
+           # Avoid broken linkage with ActivePerl, by linking directly
+           # against the Perl DLL rather than the import library.
+           (my $llibperl = "-l$libperl") =~ s/\.lib\z//;
+           my $lddlflags = $Config{lddlflags} || "";
+           my $ldflags = $Config{ldflags} || "";
+           s/-L(?:".*?"|\S+)//g foreach $lddlflags, $ldflags;
+           my $libdirs = join ' ',
+               map { s/(?<!\\)((?:\\\\)*")/\\$1/g; qq[-L"$_"] }
+               @Config{qw/bin sitebin/};
+           push @makefileopts, macro => {
+               LDDLFLAGS => "$lddlflags $libdirs $llibperl",
+               LDFLAGS => "$ldflags $libdirs $llibperl",
+               PERL_ARCHIVE => "",
+           };
+       }
+    }
+
     if ($ENV{PERL_CORE}) {
        push @makefileopts, MAN3PODS => {};
     }
index 02669de..e9dbe07 100644 (file)
@@ -91,6 +91,12 @@ XXX
 
 =item *
 
+C<Time::HiRes> has been upgraded from version 1.9721_01 to version 1.9722.
+
+Portability fix, and avoiding some compiler warnings.
+
+=item *
+
 XXX
 
 =back