1 /*
2  * O/S-dependent (mis)feature macro definitions
3  *
4 Copyright 1991, 1998  The Open Group
5 
6 Permission to use, copy, modify, distribute, and sell this software and its
7 documentation for any purpose is hereby granted without fee, provided that
8 the above copyright notice appear in all copies and that both that
9 copyright notice and this permission notice appear in supporting
10 documentation.
11 
12 The above copyright notice and this permission notice shall be included in
13 all copies or substantial portions of the Software.
14 
15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
18 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
19 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 Except as contained in this notice, the name of The Open Group shall not be
23 used in advertising or otherwise to promote the sale, use or other dealings
24 in this Software without prior written authorization from The Open Group.
25  */
26 
27 #ifndef _XOSDEFS_H_
28 #define _XOSDEFS_H_
29 
30 /*
31  * X_NOT_POSIX means does not have POSIX header files.  Lack of this
32  * symbol does NOT mean that the POSIX environment is the default.
33  * You may still have to define _POSIX_SOURCE to get it.
34  */
35 
36 #ifdef _SCO_DS
37 #ifndef __SCO__
38 #define __SCO__
39 #endif
40 #endif
41 
42 #ifdef __i386__
43 #ifdef SYSV
44 #if !defined(__SCO__) && \
45 	!defined(__UNIXWARE__) && !defined(__sun)
46 #if !defined(_POSIX_SOURCE)
47 #define X_NOT_POSIX
48 #endif
49 #endif
50 #endif
51 #endif
52 
53 #ifdef __sun
54 /* Imake configs define SVR4 on Solaris, but cc & gcc only define __SVR4
55  * This check allows non-Imake configured programs to build correctly.
56  */
57 #if defined(__SVR4) && !defined(SVR4)
58 #define SVR4 1
59 #endif
60 #ifdef SVR4
61 /* define this to whatever it needs to be */
62 #define X_POSIX_C_SOURCE 199300L
63 #endif
64 #endif
65 
66 #ifdef WIN32
67 #ifndef _POSIX_
68 #define X_NOT_POSIX
69 #endif
70 #endif
71 
72 #ifdef __APPLE__
73 #define NULL_NOT_ZERO
74 
75 /* Defining any of these will sanitize the namespace to JUST want is defined by
76  * that particular standard.  If that happens, we don't get some expected
77  * prototypes, typedefs, etc (like fd_mask).  We can define _DARWIN_C_SOURCE to
78  * loosen our belts a tad.
79  */
80 #if defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE)
81 #ifndef _DARWIN_C_SOURCE
82 #define _DARWIN_C_SOURCE
83 #endif
84 #endif
85 
86 #endif
87 
88 #ifdef __GNU__
89 #ifndef PATH_MAX
90 #define PATH_MAX 4096
91 #endif
92 #ifndef MAXPATHLEN
93 #define MAXPATHLEN 4096
94 #endif
95 #endif
96 
97 #if defined(__SCO__) || defined(__UNIXWARE__)
98 #ifndef PATH_MAX
99 #define PATH_MAX 1024
100 #endif
101 #ifndef MAXPATHLEN
102 #define MAXPATHLEN 1024
103 #endif
104 #endif
105 
106 #if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__APPLE__) || defined(__DragonFly__)
107 #ifndef CSRG_BASED
108 #define CSRG_BASED
109 #endif
110 #endif
111 
112 #endif /* _XOSDEFS_H_ */
113