From 2a0c08e48834ae056964922ee6d21ccd223d1d80 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 27 Apr 2017 18:59:24 +0200 Subject: [PATCH] wctype-h: Fix compilation error with the original mingw.org mingw. * m4/wctype_h.m4 (gl_WCTYPE_H): Test for . Set HAVE_CRTDEFS_H. * modules/wctype-h (Makefile.am): Substitute HAVE_CRTDEFS_H. * lib/wctype.in.h (rpl_wint_t): If does not exist, include instead. Reported and proposed by Eli Zaretskii . --- ChangeLog | 10 ++++++++++ lib/wctype.in.h | 12 ++++++++---- m4/wctype_h.m4 | 10 +++++++++- modules/wctype-h | 1 + 4 files changed, 28 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 12ccfc1ece..43e6639592 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2017-04-27 Bruno Haible + + wctype-h: Fix compilation error with the original mingw.org mingw. + * m4/wctype_h.m4 (gl_WCTYPE_H): Test for . Set + HAVE_CRTDEFS_H. + * modules/wctype-h (Makefile.am): Substitute HAVE_CRTDEFS_H. + * lib/wctype.in.h (rpl_wint_t): If does not exist, include + instead. + Reported and proposed by Eli Zaretskii . + 2017-04-26 Pádraig Brady nap.h: Fix compilation on non windows platforms diff --git a/lib/wctype.in.h b/lib/wctype.in.h index d307630ffc..933bf788bf 100644 --- a/lib/wctype.in.h +++ b/lib/wctype.in.h @@ -105,12 +105,16 @@ _GL_INLINE_HEADER_BEGIN # define WEOF -1 # endif #else -/* mingw and MSVC define wint_t as 'unsigned short' in . - This is too small: ISO C 99 section 7.24.1.(2) says that wint_t must be - "unchanged by default argument promotions". Override it. */ +/* mingw and MSVC define wint_t as 'unsigned short' in or + . This is too small: ISO C 99 section 7.24.1.(2) says that + wint_t must be "unchanged by default argument promotions". Override it. */ # if @GNULIB_OVERRIDES_WINT_T@ # if !GNULIB_defined_wint_t -# include +# if @HAVE_CRTDEFS_H@ +# include +# else +# include +# endif typedef unsigned int rpl_wint_t; # undef wint_t # define wint_t rpl_wint_t diff --git a/m4/wctype_h.m4 b/m4/wctype_h.m4 index 45ddaeb176..c72a73fe2e 100644 --- a/m4/wctype_h.m4 +++ b/m4/wctype_h.m4 @@ -1,4 +1,4 @@ -# wctype_h.m4 serial 18 +# wctype_h.m4 serial 19 dnl A placeholder for ISO C99 , for platforms that lack it. @@ -66,6 +66,14 @@ AC_DEFUN([gl_WCTYPE_H], fi AC_SUBST([HAVE_WCTYPE_H]) + AC_CHECK_HEADERS_ONCE([crtdefs.h]) + if test $ac_cv_header_crtdefs_h = yes; then + HAVE_CRTDEFS_H=1 + else + HAVE_CRTDEFS_H=0 + fi + AC_SUBST([HAVE_CRTDEFS_H]) + case "$gl_cv_func_iswcntrl_works" in *yes) REPLACE_ISWCNTRL=0 ;; *) REPLACE_ISWCNTRL=1 ;; diff --git a/modules/wctype-h b/modules/wctype-h index adfb218f62..37bccce984 100644 --- a/modules/wctype-h +++ b/modules/wctype-h @@ -31,6 +31,7 @@ wctype.h: wctype.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_WCTYPE_H''@|$(NEXT_WCTYPE_H)|g' \ + -e 's/@''HAVE_CRTDEFS_H''@/$(HAVE_CRTDEFS_H)/g' \ -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' \ -e 's/@''GNULIB_ISWBLANK''@/$(GNULIB_ISWBLANK)/g' \ -e 's/@''GNULIB_WCTYPE''@/$(GNULIB_WCTYPE)/g' \ -- 2.39.5