Subject: Solaris like __EXTENSIONS__ ?
To: None <current-users@netbsd.org>
From: Marc Recht <marc@informatik.uni-bremen.de>
List: current-users
Date: 04/20/2003 16:42:32
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi!

I've currently some trouble with a 3rd party application (Python 2.3/CVS) 
which sets:
_POSIX_C_SOURCE 200112L
_XOPEN_SOURCE 600
_XOPEN_SOURCE_EXTENDED 1
by default. But, it still uses eg. rpc, which won't compile, because u_int 
isn't defined in the POSIX case. Solaris solves such issues by letting the 
user define __EXTENSIONS__ to get the extended system interfaces.
Eg. (Solaris 8 sys/types.h):
#if defined(__EXTENSIONS__) || \
        (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE))
[...]

Linux has _GNU_SOURCE for such cases. I didn't find something like that on 
my 1.6R system.
IMHO is important to set something like a "POSIX++" environment, because 
it's _a lot_ easier to setup a CFLAGS with  __EXTENSIONS__=1 in the 
environment and run "configure" than changing 3rd party code.

A quick glance at 
http://www.opengroup.org/onlinepubs/007904975/basedefs/xbd_chap02.html 
showed nothing that would speak against such a define.

Regards,
Marc

mundus es fabula
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (NetBSD)

iD4DBQE+orHg7YQCetAaG3MRAopCAJjmE07HeRYH61E0UoXj/m2B0969AJ907x2Z
hoq+ajqSXGRC62U7DBu5TA==
=14or
-----END PGP SIGNATURE-----