FreeBSD 10 clang port
[oweals/cde.git] / cde / include / EUSCompat.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /*
24  *+SNOTICE
25  *
26  *      $TOG: EUSCompat.h /main/4 1998/04/03 17:11:57 mgreess $
27  *
28  *      RESTRICTED CONFIDENTIAL INFORMATION:
29  *      
30  *      The information in this document is subject to special
31  *      restrictions in a confidential disclosure agreement bertween
32  *      HP, IBM, Sun, USL, SCO and Univel.  Do not distribute this
33  *      document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
34  *      Sun's specific written approval.  This documment and all copies
35  *      and derivative works thereof must be returned or destroyed at
36  *      Sun's request.
37  *
38  *      Copyright 1993 Sun Microsystems, Inc.  All rights reserved.
39  *
40  *+ENOTICE
41  */
42
43 #ifndef _EUSCOMPAT_H
44 #define _EUSCOMPAT_H
45
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49
50 #if defined(SunOS)
51 #if (RELMAJOR==5)
52 #if (RELMINOR<2)
53 #define STRCASECMP_NOT_DEFINED
54 #endif /* RELMINOR */
55 #endif /* RELMAJOR */
56 #endif
57
58 /*
59 ** System V R4 based systems define the stuff we need in
60 ** sys/types.h. Include that and then we are done.
61 */
62 #if defined(HPUX) || defined(linux) || defined(SunOS) || defined(UNIX_SV) || defined(USL) || defined(__uxp__)
63 #include <sys/types.h>
64 #endif
65
66 #if defined(sun) && defined(_XOPEN_SOURCE)
67 #ifndef B_TRUE
68 #define B_TRUE _B_TRUE
69 #endif
70 #ifndef B_FALSE
71 #define B_FALSE _B_FALSE
72 #endif
73 #endif   /* sun && _XOPEN_SOURCE */
74
75 /*
76 ** HPUX defines most of what we need, if we set the right
77 ** include options before including the system files.
78 */
79 #if defined(HPUX)
80
81 #ifndef _INCLUDE_POSIX_SOURCE
82 #define _INCLUDE_POSIX_SOURCE
83 #endif
84
85 #ifndef _INCLUDE_XOPEN_SOURCE
86 #define _INCLUDE_XOPEN_SOURCE
87 #endif
88
89 #ifndef _INCLUDE_AES_SOURCE
90 #define _INCLUDE_AES_SOURCE
91 #endif
92
93 #ifndef _INCLUDE_HPUX_SOURCE
94 #define _INCLUDE_HPUX_SOURCE
95 #endif
96
97 #ifndef hpV4
98 typedef unsigned long ulong_t;
99 #endif /* hpV4 */
100 typedef unsigned char uchar_t;
101 typedef enum {B_FALSE, B_TRUE} boolean_t;
102
103 #define _SC_PAGESIZE    _SC_PAGE_SIZE
104
105 #ifndef MAXPATHLEN
106 #include <sys/param.h>
107 #endif
108
109 #define MAXNAMELEN      256
110
111 #endif  /* HPUX */
112
113 #if defined(linux) || defined(CSRG_BASED)
114 typedef enum {B_FALSE, B_TRUE} boolean_t;
115 #define MAXNAMELEN              256
116
117 #if !defined(__FreeBSD__)
118 #define iconv_t                 int
119 #define iconv_open(a, b)        ((iconv_t) -1)
120 #define iconv(a, b, c, d, e)    ((size_t) 0)
121 #define iconv_close(a)          (0)
122 #endif
123 #endif
124
125
126 /*
127 ** AIX, like HPUX defines most of what we need.
128 */
129 #if defined(AIX)
130
131 #ifndef KERNEL
132 #define KERNEL
133 #endif
134
135 #ifndef _BSD_INCLUDES
136 #define _BSD_INCLUDES
137 #endif
138
139 #include <sys/types.h>
140
141 #define _SC_PAGESIZE    _SC_PAGE_SIZE
142 #define vfork           fork
143
144 #ifndef MAXPATHLEN
145 #include <sys/param.h>
146 #endif
147
148 #define MAXNAMELEN      256
149
150 #ifndef _POWER
151 typedef enum {B_FALSE, B_TRUE} boolean_t;
152 #else /* _POWER */
153 #ifndef B_FALSE
154 #define B_FALSE 0
155 #endif
156 #ifndef B_TRUE
157 #define B_TRUE 1
158 #endif
159 #endif /* _POWER */
160
161 #undef BIG_ENDIAN
162
163 #endif /* AIX */
164
165 #if defined(USL) || defined(__uxp__)
166
167 #include <sys/param.h>
168
169 #define STRCASECMP_NOT_DEFINED
170 #if !defined(S_ISLNK)
171 #define S_ISLNK(mode)     (((mode) & S_IFMT) == S_IFLNK)
172 #endif
173 #endif
174
175 /*
176  * A bug in Solaris 2.1 and the GNU compilers, these are not defined.
177  */
178 #ifdef STRCASECMP_NOT_DEFINED
179   extern int strcasecmp(const char *, const char *);
180   extern int strncasecmp(const char *, const char *, size_t);
181 #endif
182
183  /*
184  ** 
185  */
186 #if defined(__osf__)
187
188 #define vfork           fork
189
190 #include <sys/types.h>
191
192 #ifndef MAXPATHLEN
193 #include <sys/param.h>
194 #endif
195
196 #ifndef MAXNAMELEN
197 #define MAXNAMELEN      256
198 #endif
199
200 typedef enum {B_FALSE, B_TRUE} boolean_t;
201
202 #undef BIG_ENDIAN
203
204 #endif /* __osf__ */
205
206 #ifdef __cplusplus
207 }
208 #endif
209
210
211 #endif