source: NonGTP/Xerces/xerces/include/xercesc/util/Compilers/CSetDefs.hpp @ 358

Revision 358, 7.3 KB checked in by bittner, 19 years ago (diff)

xerces added

Line 
1/*
2 * Copyright 1999-2002,2004 The Apache Software Foundation.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17/*
18 * $Log: CSetDefs.hpp,v $
19 * Revision 1.8  2004/09/08 13:56:32  peiyongz
20 * Apache License Version 2.0
21 *
22 * Revision 1.7  2003/05/29 11:18:37  gareth
23 * Added macros in so we can determine whether to do things like iostream as opposed to iostream.h and whether to use std:: or not.
24 *
25 * Revision 1.6  2002/11/05 21:43:55  tng
26 * Turn on C++ Namespace support only if using AIX xlC version 4 or higher.
27 *
28 * Revision 1.5  2002/11/04 14:45:20  tng
29 * C++ Namespace Support.
30 *
31 * Revision 1.4  2002/05/28 12:57:17  tng
32 * Fix typo.
33 *
34 * Revision 1.3  2002/05/27 18:02:40  tng
35 * define XMLSize_t, XMLSSize_t and their associate MAX
36 *
37 * Revision 1.2  2002/05/21 19:45:53  tng
38 * Define DOMSize_t and XMLSize_t
39 *
40 * Revision 1.1.1.1  2002/02/01 22:22:18  peiyongz
41 * sane_include
42 *
43 * Revision 1.11  2001/03/02 20:52:54  knoaman
44 * Schema: Regular expression - misc. updates for error messages,
45 * and additions of new functions to XMLString class.
46 *
47 * Revision 1.10  2001/02/05 20:01:39  tng
48 * define NO_NATIVE_BOOL macro only if not pre-defined/reserved
49 *
50 * Revision 1.9  2000/10/17 00:52:00  andyh
51 * Change XMLCh back to unsigned short on all platforms.
52 *
53 * Revision 1.8  2000/03/09 18:54:44  abagchi
54 * Added header-guards to include inlines only once
55 *
56 * Revision 1.7  2000/03/02 19:55:07  roddey
57 * This checkin includes many changes done while waiting for the
58 * 1.1.0 code to be finished. I can't list them all here, but a list is
59 * available elsewhere.
60 *
61 * Revision 1.6  2000/02/06 07:48:17  rahulj
62 * Year 2K copyright swat.
63 *
64 * Revision 1.5  2000/01/14 02:28:16  aruna1
65 * Added L"string" support for cset compiler
66 *
67 * Revision 1.4  2000/01/12 19:11:49  aruna1
68 * XMLCh now defined to wchar_t
69 *
70 * Revision 1.3  1999/11/12 20:36:51  rahulj
71 * Changed library name to xerces-c.lib.
72 *
73 * Revision 1.1.1.1  1999/11/09 01:07:31  twl
74 * Initial checkin
75 *
76 * Revision 1.3  1999/11/08 20:45:22  rahul
77 * Swat for adding in Product name and CVS comment log variable.
78 *
79 */
80
81#if !defined(CSETDEFS_HPP)
82#define CSETDEFS_HPP
83
84// ---------------------------------------------------------------------------
85//  Include some runtime files that will be needed product wide
86// ---------------------------------------------------------------------------
87#include <sys/types.h>  // for size_t and ssize_t
88#include <limits.h>  // for MAX of size_t and ssize_t
89
90// ---------------------------------------------------------------------------
91//  A define in the build for each project is also used to control whether
92//  the export keyword is from the project's viewpoint or the client's.
93//  These defines provide the platform specific keywords that they need
94//  to do this.
95// ---------------------------------------------------------------------------
96#define PLATFORM_EXPORT
97#define PLATFORM_IMPORT
98
99// ---------------------------------------------------------------------------
100//  Indicate that we do not support native bools
101//  If the compiler can handle boolean itself, do not define it
102// ---------------------------------------------------------------------------
103#if !defined(__BOOL__)
104#define NO_NATIVE_BOOL
105#endif
106
107// ---------------------------------------------------------------------------
108//  Each compiler might support L"" prefixed constants. There are places
109//  where it is advantageous to use the L"" where it supported, to avoid
110//  unnecessary transcoding.
111//  If your compiler does not support it, don't define this.
112// ---------------------------------------------------------------------------
113#define XML_LSTRSUPPORT
114
115// ---------------------------------------------------------------------------
116//  Indicate that we support C++ namespace
117//  Do not define it if the compile cannot handle C++ namespace
118// ---------------------------------------------------------------------------
119#if __IBMCPP__ >= 400
120#define XERCES_HAS_CPP_NAMESPACE
121#endif
122
123// ---------------------------------------------------------------------------
124//  Define our version of the XML character
125// ---------------------------------------------------------------------------
126typedef unsigned short XMLCh;
127
128// ---------------------------------------------------------------------------
129//  Define unsigned 16 and 32 bits integers
130// ---------------------------------------------------------------------------
131typedef unsigned short XMLUInt16;
132typedef unsigned int   XMLUInt32;
133
134// ---------------------------------------------------------------------------
135//  Define signed 32 bits integers
136// ---------------------------------------------------------------------------
137typedef int             XMLInt32;
138
139// ---------------------------------------------------------------------------
140//  XMLSize_t is the unsigned integral type.
141// ---------------------------------------------------------------------------
142#if defined(_SIZE_T) && defined(SIZE_MAX) && defined(_SSIZE_T) && defined(SSIZE_MAX)
143    typedef size_t              XMLSize_t;
144    #define XML_SIZE_MAX        SIZE_MAX
145    typedef ssize_t             XMLSSize_t;
146    #define XML_SSIZE_MAX       SSIZE_MAX
147#else
148    typedef unsigned long       XMLSize_t;
149    #define XML_SIZE_MAX        ULONG_MAX
150    typedef long                XMLSSize_t;
151    #define XML_SSIZE_MAX       LONG_MAX
152#endif
153
154
155// ---------------------------------------------------------------------------
156//  Force on the Xerces debug token if it was on in the build environment
157// ---------------------------------------------------------------------------
158#if defined(_DEBUG)
159#define XERCES_DEBUG
160#endif
161
162#if __IBMCPP__ >= 400
163#define XERCES_NEW_IOSTREAMS
164#define XERCES_STD_NAMESPACE
165#endif
166
167// ---------------------------------------------------------------------------
168//  Provide some common string ops that are different/notavail on CSet
169// ---------------------------------------------------------------------------
170inline char toupper(const char toUpper)
171{
172    if ((toUpper >= 'a') && (toUpper <= 'z'))
173        return char(toUpper - 0x20);
174    return toUpper;
175}
176
177inline char tolower(const char toLower)
178{
179    if ((toLower >= 'A') && (toLower <= 'Z'))
180        return char(toLower + 0x20);
181    return toLower;
182}
183
184int stricmp(const char* const str1, const char* const  str2);
185int strnicmp(const char* const str1, const char* const  str2, const unsigned int count);
186
187
188
189// ---------------------------------------------------------------------------
190//  The name of the DLL that is built by the CSet C++ version of the system.
191// ---------------------------------------------------------------------------
192const char* const Xerces_DLLName = "libxerces-c";
193
194#endif // CSETDEFS_HPP
195
Note: See TracBrowser for help on using the repository browser.