Add GNU LGPL headers to all .c .C and .h files
[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)
114 typedef enum {B_FALSE, B_TRUE} boolean_t;
115 #define MAXNAMELEN              256
116
117 #define iconv_t                 int
118 #define iconv_open(a, b)        ((iconv_t) -1)
119 #define iconv(a, b, c, d, e)    ((size_t) 0)
120 #define iconv_close(a)          (0)
121 #endif /* linux */
122
123
124 /*
125 ** AIX, like HPUX defines most of what we need.
126 */
127 #if defined(AIX)
128
129 #ifndef KERNEL
130 #define KERNEL
131 #endif
132
133 #ifndef _BSD_INCLUDES
134 #define _BSD_INCLUDES
135 #endif
136
137 #include <sys/types.h>
138
139 #define _SC_PAGESIZE    _SC_PAGE_SIZE
140 #define vfork           fork
141
142 #ifndef MAXPATHLEN
143 #include <sys/param.h>
144 #endif
145
146 #define MAXNAMELEN      256
147
148 #ifndef _POWER
149 typedef enum {B_FALSE, B_TRUE} boolean_t;
150 #else /* _POWER */
151 #ifndef B_FALSE
152 #define B_FALSE 0
153 #endif
154 #ifndef B_TRUE
155 #define B_TRUE 1
156 #endif
157 #endif /* _POWER */
158
159 #undef BIG_ENDIAN
160
161 #endif /* AIX */
162
163 #if defined(USL) || defined(__uxp__)
164
165 #include <sys/param.h>
166
167 #define STRCASECMP_NOT_DEFINED
168 #if !defined(S_ISLNK)
169 #define S_ISLNK(mode)     (((mode) & S_IFMT) == S_IFLNK)
170 #endif
171 #endif
172
173 /*
174  * A bug in Solaris 2.1 and the GNU compilers, these are not defined.
175  */
176 #ifdef STRCASECMP_NOT_DEFINED
177   extern int strcasecmp(const char *, const char *);
178   extern int strncasecmp(const char *, const char *, size_t);
179 #endif
180
181  /*
182  ** 
183  */
184 #if defined(__osf__)
185
186 #define vfork           fork
187
188 #include <sys/types.h>
189
190 #ifndef MAXPATHLEN
191 #include <sys/param.h>
192 #endif
193
194 #ifndef MAXNAMELEN
195 #define MAXNAMELEN      256
196 #endif
197
198 typedef enum {B_FALSE, B_TRUE} boolean_t;
199
200 #undef BIG_ENDIAN
201
202 #endif /* __osf__ */
203
204 #ifdef __cplusplus
205 }
206 #endif
207
208
209 #endif