From 591dff56c6c73eec2236af4c980e2e57e3b1c6d0 Mon Sep 17 00:00:00 2001 From: Keith Marshall Date: Thu, 14 Jul 2016 18:59:07 +0100 Subject: [PATCH] Preserve kludge to evade GCC build failure on S_ISBLK misuse. --- mingwrt/ChangeLog | 9 +++++++++ mingwrt/include/sys/stat.h | 16 ++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/mingwrt/ChangeLog b/mingwrt/ChangeLog index 7b938f9..d9daac2 100644 --- a/mingwrt/ChangeLog +++ b/mingwrt/ChangeLog @@ -1,3 +1,12 @@ +2016-07-14 Keith Marshall + + Preserve kludge to evade GCC build failure on S_ISBLK misuse. + + * include/sys/stat.h (_NO_UNSUPPORTED): New feature test macro; it + should be user defined, if desired, before inclusion; leave undefined. + [!_S_IFBLK && !_NO_UNSUPPORTED && !_NO_OLDNAMES] (S_ISBLK): Define it, + as appropriate for POSIX conforming usage; do not poison it. + 2016-07-10 Keith Marshall Fix C++ strict type checking inconsistency in diff --git a/mingwrt/include/sys/stat.h b/mingwrt/include/sys/stat.h index fb84d90..f81bfb4 100644 --- a/mingwrt/include/sys/stat.h +++ b/mingwrt/include/sys/stat.h @@ -122,11 +122,23 @@ #ifndef _S_IFBLK /* When the _S_IFBLK kludge is NOT enabled, (as it ideally should not be), - * ensure that any attempt to use its dependent macros is firmly denied. + * ensure that any attempt to use its dependent macros is denied... */ # pragma GCC poison _S_ISBLK -# pragma GCC poison S_ISBLK +# if defined _NO_UNSUPPORTED || defined _NO_OLDNAMES + /* ...including that for the standard POSIX macro, when unsupported + * features, or Microsoft's old names, are explicitly forbidden... + */ +# pragma GCC poison S_ISBLK + +# else /* !(_NO_UNSUPPORTED || _NO_OLDNAMES) */ + /* ...otherwise assume that the kludge is automatically enabled with + * respect to S_ISBLK, (because GCC gratuitously misuses it). + */ +# define S_IFBLK 0x3001 /* Block: unsupported on Win32 */ + +# endif /* !(_NO_UNSUPPORTED || _NO_OLDNAMES) */ #endif /* !_S_IFBLK */ #endif /* !__WCHAR_H_SOURCED__ */ -- 2.11.0