|
From: Keith M. <no...@so...> - 2017-01-29 14:25:13
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Repository: mingw-org-wsl".
The branch, 5.0-active has been updated
via 58fece31502adede9300337c67d4f4e0f04ba01c (commit)
via f186d677f9cb6eb23ecaaaf60e35a69a42c6a82e (commit)
from d7c921ed3389436e65fc83c91b873a764c94ac51 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://sf.net/p/mingw/mingw-org-wsl/ci/58fece31502adede9300337c67d4f4e0f04ba01c/
commit 58fece31502adede9300337c67d4f4e0f04ba01c
Author: Keith Marshall <kei...@us...>
Date: Sun Jan 29 14:24:00 2017 +0000
Clean up <limits.h> header file.
diff --git a/mingwrt/ChangeLog b/mingwrt/ChangeLog
index ebc7c4c..19d884c 100644
--- a/mingwrt/ChangeLog
+++ b/mingwrt/ChangeLog
@@ -1,5 +1,16 @@
2017-01-29 Keith Marshall <kei...@us...>
+ Clean up <limits.h> header file.
+
+ * include/limits.h: Tidy layout; assert copyright.
+ (#pragma GCC system_header): Declare it as being such.
+ (_LIMITS_H_): Rename this multiple inclusion guard macro...
+ (_LIMITS_H): ...to adopt this preferred form.
+ [__STDC_VERSION__ >= 199901L]: Infer it...
+ [_ISOC99_SOURCE]: ...from this.
+
+2017-01-29 Keith Marshall <kei...@us...>
+
Expose C99 features required by C++11; fix issue [#2335]
* include/_mingw.h.in (_ISOC99_SOURCE): Ensure it is defined for...
diff --git a/mingwrt/include/limits.h b/mingwrt/include/limits.h
index c67118c..49f7698 100644
--- a/mingwrt/include/limits.h
+++ b/mingwrt/include/limits.h
@@ -1,42 +1,60 @@
/*
* limits.h
- * This file has no copyright assigned and is placed in the Public Domain.
- * This file is a part of the mingw-runtime package.
- * No warranty is given; refer to the file DISCLAIMER within the package.
*
- * Functions for manipulating paths and directories (included from io.h)
- * plus functions for setting the current drive.
+ * Manifest constants defining the sizes of integral types.
*
- * Defines constants for the sizes of integral types.
+ * $Id$
*
- * NOTE: GCC should supply a version of this header and it should be safe to
- * use that version instead of this one (maybe safer).
+ * Written by Colin Peters <co...@bi...>
+ * Copyright (C) 1997, 1999-2001, 2004, 2005, 2010, 2012, 2017,
+ * MinGW.org Project
+ *
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice, this permission notice, and the following
+ * disclaimer shall be included in all copies or substantial portions of
+ * the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OF OR OTHER
+ * DEALINGS IN THE SOFTWARE.
*
*/
+#ifndef _LIMITS_H
+#pragma GCC system_header
+#define _LIMITS_H
-#ifndef _LIMITS_H_
-#define _LIMITS_H_
-
-/* All the headers include this file. */
+/* All MinGW headers are required to include <_mingw.h>
+ */
#include <_mingw.h>
-/*
- * File system limits
+/* File system limits
+ *
+ * TODO (REVIEW): Are NAME_MAX and OPEN_MAX file system limits, or not?
+ * Are they the same as FILENAME_MAX and FOPEN_MAX from <stdio.h>?
*
- * TODO: NAME_MAX and OPEN_MAX are file system limits or not? Are they the
- * same as FILENAME_MAX and FOPEN_MAX from stdio.h?
- * NOTE: PATH_MAX is the POSIX equivalent for Microsoft's MAX_PATH; the two
- * are semantically identical, with a limit of 259 characters for the
- * path name, plus one for a terminating NUL, for a total of 260.
+ * NOTE: PATH_MAX is the POSIX equivalent for Microsoft's MAX_PATH; the
+ * two are semantically identical, with a limit of 259 characters for the
+ * path name, plus one for a terminating NUL, making a total of 260.
*/
#ifndef __STRICT_ANSI__
# define PATH_MAX 260
#endif
-/*
- * Characteristics of the char data type.
+/* Characteristics of the char data type.
*
- * TODO: Is MB_LEN_MAX correct?
+ * FIXME: Is MB_LEN_MAX correct? Probably yes, for Microsoft MBCS, which
+ * effectively seem to all be DBCS.
*/
#define CHAR_BIT 8
#define MB_LEN_MAX 2
@@ -46,70 +64,69 @@
#define UCHAR_MAX 255
-/* TODO: Is this safe? I think it might just be testing the preprocessor,
- * not the compiler itself... */
-#if ('\x80' < 0)
-#define CHAR_MIN SCHAR_MIN
-#define CHAR_MAX SCHAR_MAX
+#if '\x80' < 0
+/* FIXME: is this safe? I think it might just be testing
+ * the preprocessor, not the compiler itself.
+ */
+# define CHAR_MIN SCHAR_MIN
+# define CHAR_MAX SCHAR_MAX
#else
-#define CHAR_MIN 0
-#define CHAR_MAX UCHAR_MAX
+# define CHAR_MIN 0
+# define CHAR_MAX UCHAR_MAX
#endif
-/*
- * Maximum and minimum values for ints.
+/* Maximum and minimum values for ints.
*/
#define INT_MAX 2147483647
#define INT_MIN (-INT_MAX-1)
-#define UINT_MAX 0xffffffff
+#define UINT_MAX 0xFFFFFFFF
-/*
- * Maximum and minimum values for shorts.
+/* Maximum and minimum values for shorts.
*/
#define SHRT_MAX 32767
#define SHRT_MIN (-SHRT_MAX-1)
-#define USHRT_MAX 0xffff
+#define USHRT_MAX 0xFFFF
-/*
- * Maximum and minimum values for longs and unsigned longs.
- *
- * TODO: This is not correct for Alphas, which have 64 bit longs.
+/* Maximum and minimum values for longs and unsigned longs;
+ * this isn't correct for Alphas, which have 64 bit longs, but
+ * that is probably no longer a concern.
*/
#define LONG_MAX 2147483647L
#define LONG_MIN (-LONG_MAX-1)
-#define ULONG_MAX 0xffffffffUL
+#define ULONG_MAX 0xFFFFFFFFUL
#ifndef __STRICT_ANSI__
-/* POSIX wants this. */
-#define SSIZE_MAX LONG_MAX
+/* POSIX wants this.
+ */
+#define SSIZE_MAX LONG_MAX
#endif
-#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \
- || !defined(__STRICT_ANSI__)
-/* ISO C9x macro names */
-#define LLONG_MAX 9223372036854775807LL
-#define LLONG_MIN (-LLONG_MAX - 1)
-#define ULLONG_MAX (2ULL * LLONG_MAX + 1)
+#if _ISOC99_SOURCE
+/* Implicitly defined in <_mingw.h>, (or explicitly defined by
+ * the user), for C99, C++, or POSIX.1-2001; make these ISO-C99
+ * macro names available.
+ */
+#define LLONG_MAX 9223372036854775807LL
+#define LLONG_MIN (-LLONG_MAX - 1)
+#define ULLONG_MAX (2ULL * LLONG_MAX + 1)
#endif
-/*
- * The GNU C compiler also allows 'long long int'
+#if defined __GNUC__ && ! defined __STRICT_ANSI__
+/* The GNU C compiler also allows 'long long int', but we don't
+ * want that capability polluting the strict ANSI namespace.
*/
-#if !defined(__STRICT_ANSI__) && defined(__GNUC__)
-
#define LONG_LONG_MAX 9223372036854775807LL
#define LONG_LONG_MIN (-LONG_LONG_MAX-1)
#define ULONG_LONG_MAX (2ULL * LONG_LONG_MAX + 1)
-/* MSVC compatibility */
-#define _I64_MIN LONG_LONG_MIN
-#define _I64_MAX LONG_LONG_MAX
-#define _UI64_MAX ULONG_LONG_MAX
-
-#endif /* Not Strict ANSI and GNU C compiler */
-
+/* MSVC compatibility
+ */
+#define _I64_MIN LONG_LONG_MIN
+#define _I64_MAX LONG_LONG_MAX
+#define _UI64_MAX ULONG_LONG_MAX
-#endif /* not _LIMITS_H_ */
+#endif /* __GNUC__ && !__STRICT_ANSI__ */
+#endif /* !_LIMITS_H: $RCSfile$: end of file */
https://sf.net/p/mingw/mingw-org-wsl/ci/f186d677f9cb6eb23ecaaaf60e35a69a42c6a82e/
commit f186d677f9cb6eb23ecaaaf60e35a69a42c6a82e
Author: Keith Marshall <kei...@us...>
Date: Sun Jan 29 10:09:49 2017 +0000
Expose C99 features required by C++11; fix issue [#2335]
diff --git a/mingwrt/ChangeLog b/mingwrt/ChangeLog
index 59beea4..ebc7c4c 100644
--- a/mingwrt/ChangeLog
+++ b/mingwrt/ChangeLog
@@ -1,3 +1,20 @@
+2017-01-29 Keith Marshall <kei...@us...>
+
+ Expose C99 features required by C++11; fix issue [#2335]
+
+ * include/_mingw.h.in (_ISOC99_SOURCE): Ensure it is defined for...
+ [__cplusplus >= 201103L]: ...this conformance level, in addition to...
+ [__STDC_VERSION__>= 199901L || _POSIX_C_SOURCE >= 200112L]: ...these.
+ [_GLIBCXX_USE_C99]: Force it for -std=c++11, subject to...
+ [__GNUC__ < 6]: ...this.
+
+ * include/ctype.h (isblank): Declare it only if...
+ [_ISOC99_SOURCE]: ...this, thus simplifying declarative condition.
+ * include/wctype.h (iswblank) [_ISOC99_SOURCE]: Likewise.
+ * include/inttypes.h (SCNd8, SCNdLEAST8, SCNdFAST8, SCNi8, SCNiLEAST8)
+ (SCNiFAST8, SCNo8, SCNoLEAST8, SCNoFAST8, SCNx8, SCNxLEAST8, SCNxFAST8)
+ (SCNu8, SCNuLEAST8, SCNuFAST8) [_ISOC99_SOURCE]: Likewise.
+
2017-01-28 Keith Marshall <kei...@us...>
Make strnlen() and wcsnlen() declaratively consistent.
diff --git a/mingwrt/include/_mingw.h.in b/mingwrt/include/_mingw.h.in
index 57fc0cc..fd99590 100644
--- a/mingwrt/include/_mingw.h.in
+++ b/mingwrt/include/_mingw.h.in
@@ -8,7 +8,7 @@
* $Id$
*
* Written by Mumit Khan <kh...@xr...>
- * Copyright (C) 1999, 2001-2011, 2014-2016, MinGW.org Project
+ * Copyright (C) 1999, 2001-2011, 2014-2017, MinGW.org Project
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -451,18 +451,62 @@ allow GCC to optimize away some EH unwind code, at least in DW2 case. */
/* libmingwex.a provides free-standing implementations for many of the
* functions which were introduced in C99; MinGW headers do not expose
* prototypes for these, unless this feature test macro is defined, by
- * the user, or implied by other standards...
+ * the user, or implied by other standards. We will use a bit-mapped
+ * representation, comprising the bit-wise sum of:
+ *
+ * 0x08 user declared
+ * 0x04 required by C compiler, supporting ISO-C99
+ * 0x02 required by C++ compiler, supporting ISO-C++11
+ * 0x01 required to support recent POSIX.1 features
+ *
+ * to ensure that we can identify the reason for implicit declaration,
+ * (in the event that we may need to discriminate).
*/
-# if __STDC_VERSION__ >= 199901L || _POSIX_C_SOURCE >= 200112L
-# define _ISOC99_SOURCE 1
+# if __STDC_VERSION__ >= 199901L
+ /* This represents a compiler supporting ISO-C99; enable all potential
+ * use of ISO-C99 features, (to the maximum extent supportable), which
+ * presumably also covers all C++11 and POSIX.1 usage.
+ */
+# define _ISOC99_SOURCE 0x07
+
+# elif __cplusplus >= 201103L
+ /* C++11 also incorporates many (if not all) of the ISO-C99 features,
+ * which we have guarded by _ISOC99_SOURCE; enable such features, to
+ * the required extent, (which is likely also sufficient to support
+ * any POSIX.1 dependencies).
+ */
+# define _ISOC99_SOURCE 0x03
+
+# elif _POSIX_C_SOURCE >= 200112L
+ /* This represents the minimum level of ISO-C99 support, which may be
+ * required by POSIX.1, (and which may be no less than full support).
+ */
+# define _ISOC99_SOURCE 0x01
# endif
+
+#else
+ /* The the user has explicitly declared a source level dependency on
+ * ISO-C99 features; regardless of how it was declared, redefine it to
+ * ensure that any plausible dependency is covered.
+ */
+# undef _ISOC99_SOURCE
+# define _ISOC99_SOURCE 0x0F
+
+#endif /* _ISOC99_SOURCE */
+
+#if _ISOC99_SOURCE && __cplusplus >= 201103L && __GNUC__ < 6
+ /* Due to a configuration defect in GCC versions prior to GCC-6, when
+ * compiling C++11 code, the ISO-C99 functions may not be incorporated
+ * into the appropriate namespace(s); we may be able to mitigate this,
+ * by ensuring that this GCC configuration macro is defined.
+ */
+# define _GLIBCXX_USE_C99 1
#endif
#if ! defined _MINGW32_SOURCE_EXTENDED && ! defined __STRICT_ANSI__
-/*
- * Enable mingw32 extensions by default, except when __STRICT_ANSI__
- * conformity mode has been enabled.
- */
+ /* Enable mingw32 extensions by default, except when __STRICT_ANSI__
+ * conformity mode has been enabled.
+ */
# define _MINGW32_SOURCE_EXTENDED 1
#endif
diff --git a/mingwrt/include/ctype.h b/mingwrt/include/ctype.h
index 7ff41a0..58fb2fd 100644
--- a/mingwrt/include/ctype.h
+++ b/mingwrt/include/ctype.h
@@ -80,7 +80,7 @@ _CRTIMP __cdecl __MINGW_NOTHROW int isspace(int);
_CRTIMP __cdecl __MINGW_NOTHROW int isupper(int);
_CRTIMP __cdecl __MINGW_NOTHROW int isxdigit(int);
-#if __STDC_VERSION__ >= 199901L || !defined __STRICT_ANSI__
+#if _ISOC99_SOURCE
__cdecl __MINGW_NOTHROW int isblank (int);
#endif
@@ -217,7 +217,7 @@ __CRT_INLINE __cdecl __MINGW_NOTHROW int isupper (int c)
__CRT_INLINE __cdecl __MINGW_NOTHROW int isxdigit (int c)
{ return __ISCTYPE(c, _HEX); }
-#if __STDC_VERSION__ >= 199901L || !defined __STRICT_ANSI__
+#if _ISOC99_SOURCE
__CRT_INLINE __cdecl __MINGW_NOTHROW int isblank (int c)
{ return (__ISCTYPE(c, _BLANK) || c == '\t'); }
#endif
diff --git a/mingwrt/include/inttypes.h b/mingwrt/include/inttypes.h
index e5e5d5b..6da1d97 100644
--- a/mingwrt/include/inttypes.h
+++ b/mingwrt/include/inttypes.h
@@ -222,10 +222,12 @@ typedef struct {
#define SCNuMAX "I64u"
#define SCNuPTR "u"
-#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-/*
- * no length modifier for char types prior to C9x
- * MS runtime scanf appears to treat "hh" as "h"
+#if _ISOC99_SOURCE
+/* Defined by the user, or implicitly in <_mingw.h>, indicating that
+ * we are compiling for C99, C++11, or POSIX.1-2001 (or later); no char
+ * type length modifiers are supported prior to C99. Further note that
+ * Microsoft's scanf() appears to treat the ISO-C99/POSIX.1 "hh" length
+ * modifier as if it were just "h".
*/
/* signed char */
@@ -249,7 +251,7 @@ typedef struct {
#define SCNu8 "hhu"
#define SCNuLEAST8 "hhu"
#define SCNuFAST8 "hhu"
-#endif /* __STDC_VERSION__ >= 199901 */
+#endif /* _ISOC99_SOURCE */
#endif /* !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) */
diff --git a/mingwrt/include/wctype.h b/mingwrt/include/wctype.h
index 492f2f0..7b7ed20 100644
--- a/mingwrt/include/wctype.h
+++ b/mingwrt/include/wctype.h
@@ -6,7 +6,7 @@
* $Id$
*
* Written by Mumit Khan <kh...@xr...>
- * Copyright (C) 1999-2003, 2005-2007, 2016, MinGW.org Project
+ * Copyright (C) 1999-2003, 2005-2007, 2016, 2017, MinGW.org Project
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -119,7 +119,7 @@ __MINGW_ATTRIB_DEPRECATED
*/
_CRTIMP __cdecl __MINGW_NOTHROW int is_wctype (wint_t, wctype_t);
-#if __STDC_VERSION__>=199901L || !defined __STRICT_ANSI__ || defined __cplusplus
+#if _ISOC99_SOURCE
__cdecl __MINGW_NOTHROW int iswblank (wint_t);
#endif
@@ -173,7 +173,7 @@ __CRT_INLINE __cdecl __MINGW_NOTHROW int iswupper (wint_t wc)
__CRT_INLINE __cdecl __MINGW_NOTHROW int iswxdigit (wint_t wc)
{ return (iswctype (wc, _HEX)); }
-#if __STDC_VERSION__>=199901L || !defined __STRICT_ANSI__ || defined __cplusplus
+#if _ISOC99_SOURCE
__CRT_INLINE __cdecl __MINGW_NOTHROW int iswblank (wint_t wc)
{ return (iswctype (wc, _BLANK) || wc == L'\t'); }
#endif
-----------------------------------------------------------------------
Summary of changes:
mingwrt/ChangeLog | 28 +++++++++
mingwrt/include/_mingw.h.in | 60 ++++++++++++++++---
mingwrt/include/ctype.h | 4 +-
mingwrt/include/inttypes.h | 12 ++--
mingwrt/include/limits.h | 137 ++++++++++++++++++++++++-------------------
mingwrt/include/wctype.h | 6 +-
6 files changed, 169 insertions(+), 78 deletions(-)
hooks/post-receive
--
Repository: mingw-org-wsl
|