Re: [Mingw-w64-public] [PATCH] inttypes.h: Take into account __USE_MINGW_ANSI_STDIO and msvcrt version instead of depending on _mingw_print_p*.h headers.

2018-11-01 Thread Liu Hao
在 2018/11/2 5:31, Jacek Caban 写道:
> The patch changes configure.ac, so you need to run autoconf after
> applying it.
> 

This patch looks good to me.


-- 
Best regards,
LH_Mouse



signature.asc
Description: OpenPGP digital signature
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [PATCH] inttypes.h: Take into account __USE_MINGW_ANSI_STDIO and msvcrt version instead of depending on _mingw_print_p*.h headers.

2018-11-01 Thread Jacek Caban

On 01/11/2018 21:35, Mateusz wrote:


W dniu 31.10.2018 o 20:12, Jacek Caban pisze:

make  all-am
make[1]: Entering directory '/home/ma/m/build/bc_m64_head'
make[1]: *** No rule to make target 'crt/_mingw_print_push.h', needed by 
'all-am'.  Stop.
make[1]: Leaving directory '/home/ma/m/build/bc_m64_head'
Makefile:542: recipe for target 'all' failed
make: *** [all] Error 2

Should I do something special to test this patch?



The patch changes configure.ac, so you need to run autoconf after 
applying it.


Jacek


___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [PATCH] inttypes.h: Take into account __USE_MINGW_ANSI_STDIO and msvcrt version instead of depending on _mingw_print_p*.h headers.

2018-11-01 Thread Mateusz
W dniu 31.10.2018 o 20:12, Jacek Caban pisze:
> We had a discussion about it and I'd like to get it back to the patch. I
> tested it some more and I think it's ready. Please review the patch.
> 
> There was a concern that applications might define
> __USE_MINGW_ANSI_STDIO but instead of including stdio.h obtaining a
> declaration in another way, ending up calling msvcrt.dll with invalid
> arguments. While such case is questionable by itself, it matters only on
> XP in practice.
> 
> This patch cleans up the code and makes PRI*64 definitions more
> consistent. It also uses C99 values for ucrt builds.
> 
> ---
>  mingw-w64-headers/configure.ac|   2 +-
>  mingw-w64-headers/crt/_mingw_print_pop.h  | 136 --
>  mingw-w64-headers/crt/_mingw_print_push.h | 136 --
>  mingw-w64-headers/crt/inttypes.h  | 129 ++--
>  mingw-w64-headers/crt/stdio.h |   4 -
>  mingw-w64-headers/crt/wchar.h |   3 -
>  mingw-w64-headers/include/wspiapi.h   |   4 -
>  7 files changed, 65 insertions(+), 349 deletions(-)
>  delete mode 100644 mingw-w64-headers/crt/_mingw_print_pop.h
>  delete mode 100644 mingw-w64-headers/crt/_mingw_print_push.h

I have some problems with this patch. It doesn't apply cleanly on my system:
ma@ma-VirtualBox:~/m/source/mingw-w64-v7$ patch -p1 <../01.diff
(Stripping trailing CRs from patch; use --binary to disable.)
patching file mingw-w64-headers/configure.ac
(Stripping trailing CRs from patch; use --binary to disable.)
patching file mingw-w64-headers/crt/_mingw_print_pop.h
...

I can't compile cross compiler with this patch:
+ /home/ma/m/source/mingw-w64-v7/mingw-w64-headers/configure 
--host=x86_64-w64-mingw32 --prefix=/home/ma/m/cross/x86_64-w64-mingw32
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for x86_64-w64-mingw32-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-w64-mingw32
checking for a sed that does not truncate output... /bin/sed
checking whether to rebuild headers with widl... no
checking whether to build a w32api package for Cygwin... no
checking for c-runtime headers... yes
checking for optional sdk headers... ddk,directx
checking if installing idl files is enabled... no
checking whether to enable the secure API... no
checking default _WIN32_WINNT version... 0x502
checking default msvcrt... msvcrt (0x700)
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating crt/_mingw.h
config.status: creating config.h
+ make
make  all-am
make[1]: Entering directory '/home/ma/m/build/bc_m64_head'
make[1]: *** No rule to make target 'crt/_mingw_print_push.h', needed by 
'all-am'.  Stop.
make[1]: Leaving directory '/home/ma/m/build/bc_m64_head'
Makefile:542: recipe for target 'all' failed
make: *** [all] Error 2

Should I do something special to test this patch?

Regards,
Mateusz



___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH] inttypes.h: Take into account __USE_MINGW_ANSI_STDIO and msvcrt version instead of depending on _mingw_print_p*.h headers.

2018-10-31 Thread Jacek Caban
We had a discussion about it and I'd like to get it back to the patch. I
tested it some more and I think it's ready. Please review the patch.

There was a concern that applications might define
__USE_MINGW_ANSI_STDIO but instead of including stdio.h obtaining a
declaration in another way, ending up calling msvcrt.dll with invalid
arguments. While such case is questionable by itself, it matters only on
XP in practice.

This patch cleans up the code and makes PRI*64 definitions more
consistent. It also uses C99 values for ucrt builds.

---
 mingw-w64-headers/configure.ac|   2 +-
 mingw-w64-headers/crt/_mingw_print_pop.h  | 136 --
 mingw-w64-headers/crt/_mingw_print_push.h | 136 --
 mingw-w64-headers/crt/inttypes.h  | 129 ++--
 mingw-w64-headers/crt/stdio.h |   4 -
 mingw-w64-headers/crt/wchar.h |   3 -
 mingw-w64-headers/include/wspiapi.h   |   4 -
 7 files changed, 65 insertions(+), 349 deletions(-)
 delete mode 100644 mingw-w64-headers/crt/_mingw_print_pop.h
 delete mode 100644 mingw-w64-headers/crt/_mingw_print_push.h


diff --git a/mingw-w64-headers/configure.ac b/mingw-w64-headers/configure.ac
index d83037e8..dda8a629 100644
--- a/mingw-w64-headers/configure.ac
+++ b/mingw-w64-headers/configure.ac
@@ -39,7 +39,7 @@ AM_CONDITIONAL([HAVE_WIDL],[AS_VAR_TEST_SET([WIDL])])
 
 # Checks for header files.
 
-BASEHEAD_LIST="crt/_bsd_types.h crt/_cygwin.h crt/_mingw.h crt/_mingw_mac.h crt/_mingw_print_push.h crt/_mingw_print_pop.h crt/_mingw_secapi.h crt/_mingw_unicode.h crt/_timeval.h crt/crtdefs.h crt/excpt.h crt/intrin.h crt/vadefs.h crt/tchar.h "$srcdir/include/*.h
+BASEHEAD_LIST="crt/_bsd_types.h crt/_cygwin.h crt/_mingw.h crt/_mingw_mac.h crt/_mingw_secapi.h crt/_mingw_unicode.h crt/_timeval.h crt/crtdefs.h crt/excpt.h crt/intrin.h crt/vadefs.h crt/tchar.h "$srcdir/include/*.h
 SECHEAD_LIST="$srcdir/crt/sec_api/stralign_s.h"
 for i in c dlg h16 hxx rh ver; do
   BASEHEAD_LIST="$BASEHEAD_LIST "$srcdir/include/*.$i
diff --git a/mingw-w64-headers/crt/_mingw_print_pop.h b/mingw-w64-headers/crt/_mingw_print_pop.h
deleted file mode 100644
index 046b6203..
--- a/mingw-w64-headers/crt/_mingw_print_pop.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
- * This file has no copyright assigned and is placed in the Public Domain.
- * This file is part of the mingw-w64 runtime package.
- * No warranty is given; refer to the file DISCLAIMER.PD within this package.
- */
-
-/* Define __mingw_ macros.  */
-#if defined(__USE_MINGW_ANSI_STDIO) && (defined(_INC_STDIO) || defined(_WSTDIO_DEFINED)) && ((__USE_MINGW_ANSI_STDIO + 0) != 0)
-
-/* Redefine to GNU specific PRI... and SCN... macros.  */
-#if defined(_INTTYPES_H_) && defined(PRId64)
-#undef PRId64
-#undef PRIdLEAST64
-#undef PRIdFAST64
-#undef PRIdMAX
-#undef PRIi64
-#undef PRIiLEAST64
-#undef PRIiFAST64
-#undef PRIiMAX
-#undef PRIo64
-#undef PRIoLEAST64
-#undef PRIoFAST64
-#undef PRIoMAX
-#undef PRIu64
-#undef PRIuLEAST64
-#undef PRIuFAST64
-#undef PRIuMAX
-#undef PRIx64
-#undef PRIxLEAST64
-#undef PRIxFAST64
-#undef PRIxMAX
-#undef PRIX64
-#undef PRIXLEAST64
-#undef PRIXFAST64
-#undef PRIXMAX
-
-#undef SCNd64
-#undef SCNdLEAST64
-#undef SCNdFAST64
-#undef SCNdMAX
-#undef SCNi64
-#undef SCNiLEAST64
-#undef SCNiFAST64
-#undef SCNiMAX
-#undef SCNo64
-#undef SCNoLEAST64
-#undef SCNoFAST64
-#undef SCNoMAX
-#undef SCNx64
-#undef SCNxLEAST64
-#undef SCNxFAST64
-#undef SCNxMAX
-#undef SCNu64
-#undef SCNuLEAST64
-#undef SCNuFAST64
-#undef SCNuMAX
-
-#ifdef _WIN64
-#undef PRIdPTR
-#undef PRIiPTR
-#undef PRIoPTR
-#undef PRIuPTR
-#undef PRIxPTR
-#undef PRIXPTR
-
-#undef SCNdPTR
-#undef SCNiPTR
-#undef SCNoPTR
-#undef SCNxPTR
-#undef SCNuPTR
-
-#endif /* _WIN64 */
-
-#define PRId64 "lld"
-#define PRIdLEAST64 "lld"
-#define PRIdFAST64 "lld"
-#define PRIdMAX "lld"
-#define PRIi64 "lli"
-#define PRIiLEAST64 "lli"
-#define PRIiFAST64 "lli"
-#define PRIiMAX "lli"
-#define PRIo64 "llo"
-#define PRIoLEAST64 "llo"
-#define PRIoFAST64 "llo"
-#define PRIoMAX "llo"
-#define PRIu64 "llu"
-#define PRIuLEAST64 "llu"
-#define PRIuFAST64 "llu"
-#define PRIuMAX "llu"
-#define PRIx64 "llx"
-#define PRIxLEAST64 "llx"
-#define PRIxFAST64 "llx"
-#define PRIxMAX "llx"
-#define PRIX64 "llX"
-#define PRIXLEAST64 "llX"
-#define PRIXFAST64 "llX"
-#define PRIXMAX "llX"
-
-#define SCNd64 "lld"
-#define SCNdLEAST64 "lld"
-#define SCNdFAST64 "lld"
-#define SCNdMAX "lld"
-#define SCNi64 "lli"
-#define SCNiLEAST64 "lli"
-#define SCNiFAST64 "lli"
-#define SCNiMAX "lli"
-#define SCNo64 "llo"
-#define SCNoLEAST64 "llo"
-#define SCNoFAST64 "llo"
-#define SCNoMAX "llo"
-#define SCNx64 "llx"
-#define SCNxLEAST64 "llx"
-#define SCNxFAST64 "llx"
-#define SCNxMAX "llx"
-#define SCNu64 "llu"
-#define SCNuLEAST64 "llu"
-#define SCNuFAST64 "llu"
-#define SCNuMAX "llu"
-
-#ifdef _WIN64
-#define PRIdPTR "lld"
-#define PRIiPTR "lli"
-#define PRIoPTR "llo"
-#define PRIuPTR "llu"
-#define PRIxPTR "llx"
-#define PRIXPTR "llX"
-