public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Fix compilation of Readline on mingw.org's MinGW
@ 2019-12-23 14:29 Eli Zaretskii
  0 siblings, 0 replies; only message in thread
From: Eli Zaretskii @ 2019-12-23 14:29 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e76ff636537c6140bb9d0b0a39260d840f37ca7e

commit e76ff636537c6140bb9d0b0a39260d840f37ca7e
Author: Eli Zaretskii <eliz@gnu.org>
Date:   Mon Dec 23 16:28:32 2019 +0200

    Fix compilation of Readline on mingw.org's MinGW
    
    readline/ChangeLog
    2019-12-23  Eli Zaretskii  <eliz@gnu.org>
    
    	* posixstat.h (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH)
    	(S_IXOTH, S_IRWXG, S_IRWXO): Define if undefined, even if S_IRWXU
    	is defined, because non-Posix systems may defined only the user
    	bits.

Diff:
---
 readline/readline/CHANGELOG   |  7 +++++++
 readline/readline/posixstat.h | 20 ++++++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/readline/readline/CHANGELOG b/readline/readline/CHANGELOG
index 18265ab..6fa1ebb 100644
--- a/readline/readline/CHANGELOG
+++ b/readline/readline/CHANGELOG
@@ -1,3 +1,10 @@
+2019-12-23  Eli Zaretskii  <eliz@gnu.org>
+
+	* posixstat.h (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH)
+	(S_IXOTH, S_IRWXG, S_IRWXO): Define if undefined, even if S_IRWXU
+	is defined, because non-Posix systems may defined only the user
+	bits.
+
 [Readline-specific changelog.  Descriptions of changes to the source are
  found in the bash changelog.]
 
diff --git a/readline/readline/posixstat.h b/readline/readline/posixstat.h
index 3eb7f29..b9d8eb3 100644
--- a/readline/readline/posixstat.h
+++ b/readline/readline/posixstat.h
@@ -132,6 +132,26 @@
 #  define S_IRWXU	(S_IRUSR | S_IWUSR | S_IXUSR)
 #  define S_IRWXG	(S_IRGRP | S_IWGRP | S_IXGRP)
 #  define S_IRWXO	(S_IROTH | S_IWOTH | S_IXOTH)
+#else  /* !S_IRWXU */
+   /* S_IRWXU is defined, but "group" and "other" bits might not be
+      (happens in certain versions of MinGW).  */
+#  if !defined (S_IRGRP)
+#    define S_IRGRP	(S_IREAD  >> 3)		/* read, group */
+#    define S_IWGRP	(S_IWRITE >> 3)		/* write, group */
+#    define S_IXGRP	(S_IEXEC  >> 3)		/* execute, group */
+#  endif /* !S_IRGRP */
+
+#  if !defined (S_IROTH)
+#    define S_IROTH	(S_IREAD  >> 6)		/* read, other */
+#    define S_IWOTH	(S_IWRITE >> 6)		/* write, other */
+#    define S_IXOTH	(S_IEXEC  >> 6)		/* execute, other */
+#  endif /* !S_IROTH */
+#  if !defined (S_IRWXG)
+#    define S_IRWXG	(S_IRGRP | S_IWGRP | S_IXGRP)
+#  endif
+#  if !defined (S_IRWXO)
+#    define S_IRWXO	(S_IROTH | S_IWOTH | S_IXOTH)
+#  endif
 #endif /* !S_IRWXU */
 
 /* These are non-standard, but are used in builtins.c$symbolic_umask() */


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-12-23 14:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-23 14:29 [binutils-gdb] Fix compilation of Readline on mingw.org's MinGW Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).