OSDN Git Service

Resolve some non-ANSI typedef omissions.
authorKeith Marshall <keithmarshall@users.sourceforge.net>
Thu, 13 Oct 2016 20:03:56 +0000 (21:03 +0100)
committerKeith Marshall <keithmarshall@users.sourceforge.net>
Thu, 13 Oct 2016 20:03:56 +0000 (21:03 +0100)
mingwrt/ChangeLog
mingwrt/include/io.h
mingwrt/include/sys/types.h

index 4d2c639..5739a02 100644 (file)
@@ -1,3 +1,14 @@
+2016-10-13  Keith Marshall  <keithmarshall@users.sourceforge.net>
+
+       Resolve some non-ANSI typedef omissions.
+
+       * include/sys/types.h (off_t, ssize_t): Always typedef them when...
+       [_POSIX_C_SOURCE || !_NO_OLDNAMES]: ...either of these prevails.
+
+       * include/io.h (_fsize_t): Do not suppress its typedef when...
+       [__STRICT_ANSI__]: ...this compiler option applies, irrespective of...
+       [!(_IO_H && _WCHAR_H)]: ...this, which otherwise causes supression.
+
 2016-09-20  Keith Marshall  <keithmarshall@users.sourceforge.net>
 
        Prepare and tag mingwrt-3.22.2 patch release.
index 70c1044..505b674 100644 (file)
 /* We must define _fsize_t, but some compilers (including GCC prior to
  * version 4.0), may choke if we try to do so more than once...
  */
-#if ! (defined _IO_H && defined _WCHAR_H)
+#if ! (defined _IO_H && defined _WCHAR_H) || defined __STRICT_ANSI__
  /* ...so DO NOT define it during direct <io.h> inclusion, (i.e. _IO_H
   * is defined), if <wchar.h> has already caused it to be defined, (i.e.
-  * _WCHAR_H is ALSO defined).
+  * _WCHAR_H is ALSO defined, but __STRICT_ANSI__ is NOT).
   */
 typedef        unsigned long   _fsize_t;
 #endif /* ! (_IO_H && _WCHAR_H) */
index 3a00343..7a5cf3d 100644 (file)
   */
   typedef __off32_t  _off_t;
 
-# if _POSIX_C_SOURCE
+# if _POSIX_C_SOURCE || ! defined _NO_OLDNAMES
   /* ...but note that this form should ALWAYS be preferred when
-   * compiling POSIX compatible source code.
+   * compiling POSIX compatible source code, and should also be
+   * made generally available unless Microsoft's old names have
+   * been suppressed, (by defining _NO_OLDNAMES).
    */
   typedef _off_t  off_t;
 # endif
 # if __GNUC__ < 4
   /* Some compilers, including GCC prior to v4, may get upset
-   * if we try to specifiy these typedefs more than once.
+   * if we try to specify these typedefs more than once.
    */
 #  define __have_typedef_off_t
 # endif
 
 # if __GNUC__ < 4
   /* Some compilers, including GCC prior to v4, may get upset
-   * if we try to specifiy these typedefs more than once.
+   * if we try to specify these typedefs more than once.
    */
 #  define __have_typedef___off64_t
 # endif
   */
   typedef int  _ssize_t;
 
-# if _POSIX_C_SOURCE
+# if _POSIX_C_SOURCE || ! defined _NO_OLDNAMES
   /* ...but note that this form should ALWAYS be preferred when
-   * compiling POSIX compatible source code.
+   * compiling POSIX compatible source code, and should also be
+   * made generally available unless Microsoft's old names have
+   * been suppressed, (by defining _NO_OLDNAMES).
    */
   typedef _ssize_t  ssize_t;
 # endif
 # if __GNUC__ < 4
   /* Some compilers, including GCC prior to v4, may get upset
-   * if we try to specifiy these typedefs more than once.
+   * if we try to specify these typedefs more than once.
    */
 #  define __have_typedef_ssize_t
 # endif