This is the mail archive of the
mailing list for the Cygwin project.
Re: Define _POSIX_SOURCE in cygwin's features.h?
-----BEGIN PGP SIGNED MESSAGE-----
Christopher Faylor wrote:
> I guess more subtext that you could read into my request would be that
> we would make the headers work as closely as possible to linux when
> _POSIX_SOURCE is defined. The key here is to make things look more
> like linux so that programs port more easily.
Right now, all _POSIX_SOURCE seems to do is exclude a number of
constants and functions from being defined, supposedly because they
aren't part of the POSIX standard.
Now, newlib != glibc, but the examples I mentioned before could be
compared to their glib counterparts (see below regarding <sys/select.h>).
> So, that would imply that "we" really should actively fix up the headers
> to make sure that it is properly handled.
OK, but I think these are uncommon cases; I've built a *LOT* of packages
of all types, and this has not generally been a problem.
> I was hoping for concrete examples. Do you have any?
gmime-gpg-context.c: In function `gpg_ctx_op_step':
gmime-gpg-context.c:1089: error: `fd_set' undeclared (first use in this
gmime-gpg-context.c:1089: error: (Each undeclared identifier is reported
gmime-gpg-context.c:1089: error: for each function it appears in.)
gmime-gpg-context.c:1089: error: parse error before "rdset"
gmime-gpg-context.c:1096: error: `rdset' undeclared (first use in this
gmime-gpg-context.c:1114: error: `wrset' undeclared (first use in this
gmime-gpg-context.c:1124: error: `wrsetp' undeclared (first use in this
fd_set is defined in <sys/types.h> (which is also called by
<sys/select.h>, but only if !defined(_POSIX_SOURCE)), but with this
/* We don't define fd_set and friends if we are compiling POSIX
source, or if we have included (or may include as indicated
by __USE_W32_SOCKETS) the W32api winsock.h header which
defines Windows versions of them. Note that a program which
includes the W32api winsock.h header must know what it is doing;
it must not call the cygwin32 select function.
# if !(defined (_POSIX_SOURCE) || defined (_WINSOCK_H) || defined
AFAICS, in glibc, fd_set is (independent of _POSIX_SOURCE) defined via
Since _POSIX_SOURCE on Cygwin doesn't add anything, I can't remember a
case that I've had to *add* such a define.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html