Convert sv_2mortal(newSVpvn()) to newSVpvn_flags(), for 5.11.0 and later.
Nicholas Clark [Fri, 16 Oct 2009 10:59:48 +0000 (11:59 +0100)]
dist/IO/IO.pm
dist/IO/IO.xs

index c63648e..61e957c 100644 (file)
@@ -7,7 +7,7 @@ use Carp;
 use strict;
 use warnings;
 
-our $VERSION = "1.25_01";
+our $VERSION = "1.25_02";
 XSLoader::load 'IO', $VERSION;
 
 sub import {
index d3dff55..08fefb0 100644 (file)
@@ -158,7 +158,11 @@ fgetpos(handle)
            if (fgetpos(handle, &pos)) {
                ST(0) = &PL_sv_undef;
            } else {
+#  if PERL_VERSION >= 11
+               ST(0) = newSVpvn_flags((char*)&pos, sizeof(Fpos_t), SVs_TEMP);
+#  else
                ST(0) = sv_2mortal(newSVpvn((char*)&pos, sizeof(Fpos_t)));
+#  endif
            }
 #endif
        }