[PATCH] grp.h: use __BSD_VISIBLE and __XSI_VISIBLE guards
Corinna Vinschen
vinschen@redhat.com
Thu Jan 28 10:40:00 GMT 2016
On Jan 28 11:33, Corinna Vinschen wrote:
> On Jan 27 21:48, Yaakov Selkowitz wrote:
> > This fixes the build of krb5 and other packages on Cygwin.
> >
> > * libc/include/grp.h: Use __BSD_VISIBLE and __XSI_VISIBLE guards.
> >
> > Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
> > ---
> > newlib/libc/include/grp.h | 8 ++++----
> > 1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/newlib/libc/include/grp.h b/newlib/libc/include/grp.h
> > index c3a5a67..c75d525 100644
> > --- a/newlib/libc/include/grp.h
> > +++ b/newlib/libc/include/grp.h
> > @@ -71,21 +71,21 @@ int getgrnam_r (const char *, struct group *,
> > char *, size_t, struct group **);
> > int getgrgid_r (gid_t, struct group *,
> > char *, size_t, struct group **);
> > -#ifndef _POSIX_SOURCE
> > +#if __BSD_VISIBLE || __XSI_VISIBLE >= 500
> > struct group *getgrent (void);
> > void setgrent (void);
> > void endgrent (void);
> > #ifndef __CYGWIN__
> > void setgrfile (const char *);
> > #endif /* !__CYGWIN__ */
> > -#ifndef _XOPEN_SOURCE
> > +#if __BSD_VISIBLE
> > #ifndef __CYGWIN__
> > char *group_from_gid (gid_t, int);
> > int setgroupent (int);
> > #endif /* !__CYGWIN__ */
> > int initgroups (const char *, gid_t);
> > -#endif /* !_XOPEN_SOURCE */
> > -#endif /* !_POSIX_SOURCE */
> > +#endif /* __BSD_VISIBLE */
> > +#endif /* __BSD_VISIBLE || __XSI_VISIBLE >= 500 */
> > #endif /* !__INSIDE_CYGWIN__ */
>
> This nesting of __BSD_VISIBLE and __XSI_VISIBLE doesn't make sense
> (the former nesting of _POSIX_SOURCE and _XOPEN_SOURCE didn't either)
> and complicates reading the source.
> Would you mind to change that to
>
> #if __BSD_VISIBLE || __XSI_VISIBLE >= 500
> [...]
> #endif
> #if __BSD_VISIBLE
> [...]
> #endif
>
> ?
>
> With that change, ok to commit.
Btw., does *anybody* here use/provide any of the non-standard functions
setgrfile, setgroupent, and group_from_gid?
RTEMS?
If not, I think it might be prudent to remove this cruft.
Thanks,
Corinna
--
Corinna Vinschen
Cygwin Maintainer
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20160128/d2903360/attachment.sig>
More information about the Newlib
mailing list