Link with C++ linker
[oweals/cde.git] / cde / programs / nsgmls / config.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 /* $XConsortium: config.h /main/1 1996/07/29 17:08:30 cde-hp $ */
24 // Copyright (c) 1994 James Clark
25 // See the file COPYING for copying permission.
26
27 #ifndef config_INCLUDED
28 #define config_INCLUDED 1
29
30 #define SP_INCLUDE_UNISTD_H
31 #define SP_POSIX_FILENAMES
32
33 #ifdef __GNUG__
34 // It's not missing, but it pulls in libg++
35 #define SP_NEW_H_MISSING
36 // set_new_handler() has to be declared extern "C"
37 #define SP_SET_NEW_HANDLER_EXTERN_C
38 #ifndef SP_MANUAL_INST
39 #define SP_MANUAL_INST
40 #endif
41 #ifndef SP_ANSI_CLASS_INST
42 #define SP_ANSI_CLASS_INST
43 #endif
44 #ifndef SP_HAVE_BOOL
45 #define SP_HAVE_BOOL
46 #endif
47 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
48 #define SP_ANSI_FOR_SCOPE
49 #endif
50
51 #endif /* __GNUG__ */
52
53 #if defined(sun) || defined(__sun)
54 // struct stat has st_blksize member
55 #define SP_STAT_BLKSIZE
56 #endif
57
58 #ifdef __EMX__
59 // EMX 0.9a for OS/2
60 #undef SP_POSIX_FILENAMES
61 #define SP_MSDOS_FILENAMES
62 #endif
63
64 #ifdef _MSC_VER
65 // Microsoft Visual C++ 4.0
66 #undef SP_INCLUDE_UNISTD_H
67 #define SP_INCLUDE_IO_H
68 #ifndef SP_ANSI_CLASS_INST
69 #define SP_ANSI_CLASS_INST
70 #endif
71 #undef SP_POSIX_FILENAMES
72 #define SP_MSDOS_FILENAMES
73 #define SP_SHORT_HEADERS
74 #pragma warning ( disable : 4660 ) // already instantiated
75 #pragma warning ( disable : 4661 ) // missing def for decl member
76 #pragma warning ( disable : 4786 ) // debug symbol truncated (>255 chars)
77 #pragma warning ( disable : 4018 ) // signed/unsigned mismatch
78 #pragma warning ( disable : 4251 ) // __declspec(dllexport)
79 #pragma warning ( disable : 4275 )
80 #pragma warning ( disable : 4237 ) // future reserved keyword
81 #define huge verybig
82 #if _MSC_VER == 900
83 #define SP_DECLARE_PLACEMENT_OPERATOR_NEW
84 #endif
85 #define set_new_handler _set_new_handler
86 // Function passed to set_new_handler() returns int and takes size_t argument.
87 #define SP_FANCY_NEW_HANDLER
88
89 #define SP_HAVE_SETMODE
90 #define SP_DLLEXPORT __declspec(dllexport)
91 #define SP_DLLIMPORT __declspec(dllimport)
92
93 #ifdef _DLL
94 #define SP_USE_DLL
95 #endif
96
97 #ifdef SP_USE_DLL
98 #ifndef BUILD_LIBSP
99 // It's not possible to export templates using __declspec(dllexport),
100 // so instead we include the template definitions in the headers,
101 // which allows Visual C++ to instantiate any needed templates
102 // in the client.
103 #define SP_DEFINE_TEMPLATES
104 #endif
105 #endif /* SP_USE_DLL */
106
107 #ifndef SP_MANUAL_INST
108 #ifndef SP_DEFINE_TEMPLATES
109 #define SP_MANUAL_INST
110 #endif
111 #endif /* not SP_MANUAL_INST */
112
113 // Make sure both _UNICODE and UNICODE are defined if either is.
114
115 #ifdef _UNICODE
116 #ifndef UNICODE
117 #define UNICODE
118 #endif /* not UNICODE */
119 #endif /* _UNICODE */
120
121 #ifdef UNICODE
122 #ifndef _UNICODE
123 #define _UNICODE
124 #endif /* not _UNICODE */
125 #endif /* UNICODE */
126
127 #ifdef _UNICODE
128 #define SP_WIDE_SYSTEM
129 #endif
130
131 // wchar_t's base type is an unsigned short
132 #define SP_WCHAR_T_USHORT
133
134 // Enable precompiled header support.
135 #define SP_PCH
136 // Don't compile in message text.
137 #define SP_NO_MESSAGE_TEXT
138 #endif /* _MSC_VER */
139
140 #ifdef __WATCOMC__
141 // Watcom C++ 10.0a
142 #define SP_MANUAL_INST
143 #undef SP_POSIX_FILENAMES
144 #define SP_MSDOS_FILENAMES
145 #undef SP_INCLUDE_UNISTD_H
146 #define SP_INCLUDE_IO_H
147 #pragma warning 004 9
148 #undef huge
149 // Cannot handle T::~T in template.
150 #define SP_QUAL_TEMPLATE_DTOR_BROKEN
151 #define SP_HAVE_SETMODE
152 #define _setmode setmode
153 #if __WATCOMC__ < 1050
154 #define _O_BINARY O_BINARY
155 #endif
156 #define SP_WCHAR_T_USHORT
157 #endif /* __WATCOMC__ */
158
159 #ifdef __BORLANDC__
160 // Borland C++ 5.0
161 #define SP_ANSI_FOR_SCOPE
162 #define SP_HAVE_RTTI
163 #define SP_HAVE_SETMODE
164 #undef SP_INCLUDE_UNISTD_H
165 #define SP_INCLUDE_IO_H
166 #undef SP_POSIX_FILENAMES
167 #define SP_MSDOS_FILENAMES
168 #define SP_HAVE_BOOL
169 #define SP_SHORT_HEADERS
170 #define _O_BINARY O_BINARY
171 #define _setmode setmode
172 #define SP_ANSI_CLASS_INST
173 #define SP_MANUAL_INST
174 // Building as a DLL doesn't work with Borland C++ yet.
175 #define SP_DLLEXPORT __declspec(dllexport)
176 #define SP_DLLIMPORT __declspec(dllimport)
177 #ifdef SP_USE_DLL
178 #ifndef BUILD_LIBSP
179 #define SP_DEFINE_TEMPLATES
180 #endif
181 #endif /* SP_USE_DLL */
182 #define SP_WCHAR_T_USHORT
183 #endif /* __BORLANDC__ */
184
185 #ifdef __IBMCPP__
186 // IBM CSet++ 2.1 from Horst Szillat <szillat@berlin.snafu.de>.
187 #undef SP_POSIX_FILENAMES
188 #define SP_MANUAL_INST
189 #define SP_SHORT_HEADERS
190 #define SP_MSDOS_FILENAMES
191 #undef SP_INCLUDE_UNISTD_H
192 #define SP_INCLUDE_IO_H
193 #define S_IFMT (S_IFDIR|S_IFCHR|S_IFREG)
194 #endif
195
196 #ifndef SP_ANSI_FOR_SCOPE
197 // This simulates the new ANSI "for" scope rules
198 #define for if (0); else for
199 #endif
200
201 #ifndef SP_DLLEXPORT
202 #define SP_DLLEXPORT /* as nothing */
203 #endif
204
205 #ifndef SP_DLLIMPORT
206 #define SP_DLLIMPORT /* as nothing */
207 #endif
208
209 #ifdef SP_USE_DLL
210
211 #ifdef BUILD_LIBSP
212 #define SP_API SP_DLLEXPORT
213 #else
214 #define SP_API SP_DLLIMPORT
215 #endif
216
217 #else /* not SP_USE_DLL */
218
219 #define SP_API /* as nothing */
220
221 #endif /* not SP_USE_DLL */
222
223 // SP_WIDE_SYSTEM says that your OS provides wide character interfaces
224 // SP_WIDE_SYSTEM currently works only with Visual C++ and Windows NT
225 // SP_WIDE_SYSTEM implies SP_MULTI_BYTE
226 #ifdef SP_WIDE_SYSTEM
227 #define SP_MULTI_BYTE
228 #endif
229
230 #ifdef SP_NAMESPACE
231 #define SP_NAMESPACE_SCOPE SP_NAMESPACE::
232 #else
233 #define SP_NAMESPACE_SCOPE
234 #endif
235
236 #endif /* not config_INCLUDED */