117ca54c3Smrg/*
217ca54c3Smrg * O/S-dependent (mis)feature macro definitions
317ca54c3Smrg *
417ca54c3SmrgCopyright 1991, 1998  The Open Group
517ca54c3Smrg
617ca54c3SmrgPermission to use, copy, modify, distribute, and sell this software and its
717ca54c3Smrgdocumentation for any purpose is hereby granted without fee, provided that
817ca54c3Smrgthe above copyright notice appear in all copies and that both that
917ca54c3Smrgcopyright notice and this permission notice appear in supporting
1017ca54c3Smrgdocumentation.
1117ca54c3Smrg
1217ca54c3SmrgThe above copyright notice and this permission notice shall be included in
1317ca54c3Smrgall copies or substantial portions of the Software.
1417ca54c3Smrg
1517ca54c3SmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1617ca54c3SmrgIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1717ca54c3SmrgFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
1817ca54c3SmrgOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
1917ca54c3SmrgAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
2017ca54c3SmrgCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2117ca54c3Smrg
2217ca54c3SmrgExcept as contained in this notice, the name of The Open Group shall not be
2317ca54c3Smrgused in advertising or otherwise to promote the sale, use or other dealings
2417ca54c3Smrgin this Software without prior written authorization from The Open Group.
2517ca54c3Smrg */
2617ca54c3Smrg
2717ca54c3Smrg#ifndef _XOSDEFS_H_
2817ca54c3Smrg# define _XOSDEFS_H_
2917ca54c3Smrg
3017ca54c3Smrg/*
3117ca54c3Smrg * X_NOT_POSIX means does not have POSIX header files.  Lack of this
3217ca54c3Smrg * symbol does NOT mean that the POSIX environment is the default.
3317ca54c3Smrg * You may still have to define _POSIX_SOURCE to get it.
3417ca54c3Smrg */
3517ca54c3Smrg
3617ca54c3Smrg
3717ca54c3Smrg# ifdef _SCO_DS
3817ca54c3Smrg#  ifndef __SCO__
3917ca54c3Smrg#   define __SCO__
4017ca54c3Smrg#  endif
4117ca54c3Smrg# endif
4217ca54c3Smrg
4317ca54c3Smrg# ifdef __i386__
4417ca54c3Smrg#  ifdef SYSV
4517ca54c3Smrg#   if !defined(__SCO__) && \
4617ca54c3Smrg	!defined(__UNIXWARE__) && !defined(__sun)
4717ca54c3Smrg#    if !defined(_POSIX_SOURCE)
4817ca54c3Smrg#     define X_NOT_POSIX
4917ca54c3Smrg#    endif
5017ca54c3Smrg#   endif
5117ca54c3Smrg#  endif
5217ca54c3Smrg# endif
5317ca54c3Smrg
5417ca54c3Smrg# ifdef __sun
5517ca54c3Smrg/* Imake configs define SVR4 on Solaris, but cc & gcc only define __SVR4
5617ca54c3Smrg * This check allows non-Imake configured programs to build correctly.
5717ca54c3Smrg */
5817ca54c3Smrg#  if defined(__SVR4) && !defined(SVR4)
5917ca54c3Smrg#   define SVR4 1
6017ca54c3Smrg#  endif
6117ca54c3Smrg#  ifdef SVR4
6217ca54c3Smrg/* define this to whatever it needs to be */
6317ca54c3Smrg#   define X_POSIX_C_SOURCE 199300L
6417ca54c3Smrg#  endif
6517ca54c3Smrg# endif
6617ca54c3Smrg
6717ca54c3Smrg# ifdef WIN32
6817ca54c3Smrg#  ifndef _POSIX_
6917ca54c3Smrg#   define X_NOT_POSIX
7017ca54c3Smrg#  endif
7117ca54c3Smrg# endif
7217ca54c3Smrg
7317ca54c3Smrg
7417ca54c3Smrg# ifdef __APPLE__
7517ca54c3Smrg#  define NULL_NOT_ZERO
7617ca54c3Smrg
7717ca54c3Smrg/* Defining any of these will sanitize the namespace to JUST want is defined by
7817ca54c3Smrg * that particular standard.  If that happens, we don't get some expected
7917ca54c3Smrg * prototypes, typedefs, etc (like fd_mask).  We can define _DARWIN_C_SOURCE to
8017ca54c3Smrg * loosen our belts a tad.
8117ca54c3Smrg */
8217ca54c3Smrg#  if defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE)
8317ca54c3Smrg#   ifndef _DARWIN_C_SOURCE
8417ca54c3Smrg#    define _DARWIN_C_SOURCE
8517ca54c3Smrg#   endif
8617ca54c3Smrg#  endif
8717ca54c3Smrg
8817ca54c3Smrg# endif
8917ca54c3Smrg
9017ca54c3Smrg# ifdef __GNU__
9117ca54c3Smrg#  ifndef PATH_MAX
9217ca54c3Smrg#   define PATH_MAX 4096
9317ca54c3Smrg#  endif
9417ca54c3Smrg#  ifndef MAXPATHLEN
9517ca54c3Smrg#   define MAXPATHLEN 4096
9617ca54c3Smrg#  endif
9717ca54c3Smrg# endif
9817ca54c3Smrg
9917ca54c3Smrg# if defined(__SCO__) || defined(__UNIXWARE__)
10017ca54c3Smrg#  ifndef PATH_MAX
10117ca54c3Smrg#   define PATH_MAX	1024
10217ca54c3Smrg#  endif
10317ca54c3Smrg#  ifndef MAXPATHLEN
10417ca54c3Smrg#   define MAXPATHLEN	1024
10517ca54c3Smrg#  endif
10617ca54c3Smrg# endif
10717ca54c3Smrg
10817ca54c3Smrg# if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) \
10917ca54c3Smrg	|| defined(__APPLE__) || defined(__DragonFly__)
11017ca54c3Smrg#  ifndef CSRG_BASED
11117ca54c3Smrg#   define CSRG_BASED
11217ca54c3Smrg#  endif
11317ca54c3Smrg# endif
11417ca54c3Smrg
11517ca54c3Smrg#endif /* _XOSDEFS_H_ */
11617ca54c3Smrg
117