This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix longdblsize and nvsize for 64-bit USE_LONG_DOUBLE builds on Windows
authorSteve Hay <steve.m.hay@googlemail.com>
Fri, 21 Nov 2014 18:39:04 +0000 (18:39 +0000)
committerSteve Hay <steve.m.hay@googlemail.com>
Fri, 21 Nov 2014 18:39:55 +0000 (18:39 +0000)
This fixes many test failures in op/pack.t, although two (13177 and 13180)
still remain.  The same two also fail with 32-bit USE_LONG_DOUBLE builds.

Thanks to sisyphus1@optusnet.com.au for spotting the failures and the
likely cause of them.

win32/config_sh.PL
win32/makefile.mk

index 035f03f..60fb4ed 100644 (file)
@@ -214,7 +214,14 @@ if ($opt{uselongdouble} eq 'define') {
     $opt{d_PRIfldbl} = 'define';
     $opt{d_PRIgldbl} = 'define';
     $opt{d_SCNfldbl} = 'define';
-    $opt{nvsize} = 12;
+    if ($opt{WIN64} eq 'define') {
+        $opt{longdblsize} = 16;
+        $opt{nvsize} = 16;
+    }
+    else {
+        $opt{longdblsize} = 12;
+        $opt{nvsize} = 12;
+    }
     $opt{nvtype} = 'long double';
     $opt{nv_overflows_integers_at} = '256.0*256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0*2.0*2.0*2.0';
     $opt{nvEUformat} = '"LE"';
@@ -239,6 +246,7 @@ else {
     $opt{d_PRIfldbl} = 'undef';
     $opt{d_PRIgldbl} = 'undef';
     $opt{d_SCNfldbl} = 'undef';
+    $opt{longdblsize} = 8;
     $opt{nvsize} = 8;
     $opt{nvtype} = 'double';
     $opt{nv_overflows_integers_at} = '256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0';
index f6356f6..19cc265 100644 (file)
@@ -1073,6 +1073,7 @@ config.w32 : $(CFGSH_TMPL)
        @echo #undef PERL_SCNfldbl>>$@
        @echo #undef NVTYPE>>$@
        @echo #undef NVSIZE>>$@
+       @echo #undef LONG_DOUBLESIZE>>$@
        @echo #undef NV_OVERFLOWS_INTEGERS_AT>>$@
        @echo #undef NVef>>$@
        @echo #undef NVff>>$@
@@ -1147,7 +1148,13 @@ config.w32 : $(CFGSH_TMPL)
        @echo #define PERL_PRIeldbl "Le">>$@
        @echo #define PERL_SCNfldbl "Lf">>$@
        @echo #define NVTYPE long double>>$@
+.IF "$(WIN64)"=="define"
+       @echo #define NVSIZE ^16>>$@
+       @echo #define LONG_DOUBLESIZE ^16>>$@
+.ELSE
        @echo #define NVSIZE ^12>>$@
+       @echo #define LONG_DOUBLESIZE ^12>>$@
+.ENDIF
        @echo #define NV_OVERFLOWS_INTEGERS_AT 256.0*256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0*2.0*2.0*2.0>>$@
        @echo #define NVef "Le">>$@
        @echo #define NVff "Lf">>$@
@@ -1167,6 +1174,7 @@ config.w32 : $(CFGSH_TMPL)
        @echo #undef PERL_SCNfldbl>>$@
        @echo #define NVTYPE double>>$@
        @echo #define NVSIZE ^8>>$@
+       @echo #define LONG_DOUBLESIZE ^8>>$@
        @echo #define NV_OVERFLOWS_INTEGERS_AT 256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0>>$@
        @echo #define NVef "e">>$@
        @echo #define NVff "f">>$@