[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl5-porters
Subject:    Re: [perl #130447] Win32: Define __USE_MINGW_ANSI_STDIO for all gcc builds
From:       <sisyphus1 () optusnet ! com ! au>
Date:       2017-10-27 5:58:36
Message-ID: 51BA63A26FB34BB4A65A44750D9E40FB () OwnerPC311012
[Download RAW message or body]

-----Original Message----- 
From: sisyphus1@optusnet.com.au
Sent: Wednesday, May 31, 2017 9:21 PM
To: Steve Hay ; kmx
Cc: perlbug-followup@perl.org ; perl5-porters@perl.org ; Andy Grundman ; Jan 
Dubois
Subject: Re: [perl #130447] Win32: Define __USE_MINGW_ANSI_STDIO for all gcc 
builds

Since nothing has happened with this, AFAICT, I thought I'd send a patch 
(attached) against the win32/GNUmakefile that shipped with perl-5.27.5.

It merely gives one the *option* of building with -D__USE_MINGW_ANSI_STDIO 
when building with nvtype=double.
With the patch applied, the default for such builds is still to build 
*without* defining __USE_MINGW_ANSI_STDIO - as has always been the default 
for the "nvtype=double" builds.

For "nvtype=long double" builds (as has always been the 
case) -D__USE_MINGW_ANSI_STDIO is inevitably defined  .... unless, of 
course, one hacks the contents  of the GNUmakefile.
I don't see any value in building "nvtype=long double" builds without 
defining __USE_MINGW_ANSI_STDIO, and see no need to provide such an option.

I hope that someone can apply this patch.
I've tested it and it works as intended.

If it's deemed more appropriate that -D__USE_MINGW_ANSI_STDIO  should be the 
*default* for "nvtype=double" builds, then I'd be quite happy with that 
change, too.

Cheers,
Rob 

["GNUmakefile.diff" (application/octet-stream)]

--- GNUmakefile.orig	2017-10-26 20:41:34 +1100
+++ GNUmakefile	2017-10-26 22:21:44 +1100
@@ -136,6 +136,14 @@
 #USE_LONG_DOUBLE :=define
 
 #
+# Uncomment this if you want to build perl with __USE_MINGW_ANSI_STDIO defined.
+# (If you're building perl with USE_LONG_DOUBLE defined then
+# __USE_MINGW_ANSI_STDIO will be defined whether or not this is uncommented.)
+# This option is not supported for MSVC builds.
+#
+#USE_MINGW_ANSI_STDIO :=define
+
+#
 # Comment this out if you want the legacy default behavior of including '.' at
 # the end of @INC.
 #
@@ -523,6 +531,11 @@
 ifeq ($(USE_LONG_DOUBLE),define)
 BUILDOPT        += -D__USE_MINGW_ANSI_STDIO
 MINIBUILDOPT    += -D__USE_MINGW_ANSI_STDIO
+else
+ifeq ($(USE_MINGW_ANSI_STDIO),define)
+BUILDOPT        += -D__USE_MINGW_ANSI_STDIO
+MINIBUILDOPT    += -D__USE_MINGW_ANSI_STDIO
+endif
 endif
 
 GCCVER1   := $(shell for /f "delims=. tokens=1,2,3" %%i in ('gcc -dumpversion') do echo %%i)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic