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

Revision 358, 7.9 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: MVSCPPDefs.hpp,v $
19 * Revision 1.9  2004/09/08 13:56:32  peiyongz
20 * Apache License Version 2.0
21 *
22 * Revision 1.8  2003/01/30 19:09:50  tng
23 * [Bug 3041] wrong PLATFORM_IMPORT in MVSCPPDefs.hpp
24 *
25 * Revision 1.7  2003/01/20 19:28:52  tng
26 * 390: turn on C++ namespace.  Patch from Stephen Dulin.
27 *
28 * Revision 1.6  2002/11/04 14:45:20  tng
29 * C++ Namespace Support.
30 *
31 * Revision 1.5  2002/08/08 16:40:16  tng
32 * 390 Changes from Stephen Dulin.
33 *
34 * Revision 1.4  2002/05/28 12:57:17  tng
35 * Fix typo.
36 *
37 * Revision 1.3  2002/05/27 18:02:40  tng
38 * define XMLSize_t, XMLSSize_t and their associate MAX
39 *
40 * Revision 1.2  2002/05/21 19:45:53  tng
41 * Define DOMSize_t and XMLSize_t
42 *
43 * Revision 1.1.1.1  2002/02/01 22:22:18  peiyongz
44 * sane_include
45 *
46 * Revision 1.8  2001/03/02 20:53:03  knoaman
47 * Schema: Regular expression - misc. updates for error messages,
48 * and additions of new functions to XMLString class.
49 *
50 * Revision 1.7  2000/10/17 00:52:00  andyh
51 * Change XMLCh back to unsigned short on all platforms.
52 *
53 * Revision 1.6  2000/03/09 18:54:44  abagchi
54 * Added header-guards to include inlines only once
55 *
56 * Revision 1.5  2000/03/02 19:55:08  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.4  2000/02/16 22:51:04  abagchi
62 * defined PLATFORM_EXPORT to _Export
63 *
64 * Revision 1.3  2000/02/08 02:32:59  abagchi
65 * Changed characters from ASCII to Hex
66 *
67 * Revision 1.2  2000/02/06 07:48:17  rahulj
68 * Year 2K copyright swat.
69 *
70 * Revision 1.1  2000/01/21 22:15:55  abagchi
71 * Initial check-in for OS390: added MVSCPPDefs.hpp and MVSCPPDefs.cpp
72 *
73 * Revision 1.5  2000/01/14 02:28:16  aruna1
74 * Added L"string" support for cset compiler
75 *
76 * Revision 1.4  2000/01/12 19:11:49  aruna1
77 * XMLCh now defined to wchar_t
78 *
79 * Revision 1.3  1999/11/12 20:36:51  rahulj
80 * Changed library name to xerces-c.lib.
81 *
82 * Revision 1.1.1.1  1999/11/09 01:07:31  twl
83 * Initial checkin
84 *
85 * Revision 1.3  1999/11/08 20:45:22  rahul
86 * Swat for adding in Product name and CVS comment log variable.
87 *
88 */
89
90#if !defined(MVSCPPDEFS_HPP)
91#define MVSCPPDEFS_HPP
92
93// ---------------------------------------------------------------------------
94//  Include some runtime files that will be needed product wide
95// ---------------------------------------------------------------------------
96#include <sys/types.h>  // for size_t and ssize_t
97#include <limits.h>  // for MAX of size_t and ssize_t
98
99// ---------------------------------------------------------------------------
100//  A define in the build for each project is also used to control whether
101//  the export keyword is from the project's viewpoint or the client's.
102//  These defines provide the platform specific keywords that they need
103//  to do this.
104// ---------------------------------------------------------------------------
105#define PLATFORM_EXPORT _Export
106#define PLATFORM_IMPORT
107
108// ---------------------------------------------------------------------------
109//  Indicate that we do not support native bools
110//  If the compiler can handle boolean itself, do not define it
111// ---------------------------------------------------------------------------
112//#define NO_NATIVE_BOOL
113
114// ---------------------------------------------------------------------------
115//  Each compiler might support L"" prefixed constants. There are places
116//  where it is advantageous to use the L"" where it supported, to avoid
117//  unnecessary transcoding.
118//  If your compiler does not support it, don't define this.
119// ---------------------------------------------------------------------------
120#define XML_LSTRSUPPORT
121
122// ---------------------------------------------------------------------------
123//  Indicate that we support C++ namespace
124//  Do not define it if the compile cannot handle C++ namespace
125// ---------------------------------------------------------------------------
126#define XERCES_HAS_CPP_NAMESPACE
127
128// ---------------------------------------------------------------------------
129//  Define our version of the XML character
130// ---------------------------------------------------------------------------
131typedef unsigned short XMLCh;
132// typedef wchar_t XMLCh;
133
134// ---------------------------------------------------------------------------
135//  Define unsigned 16 and 32 bits integers
136// ---------------------------------------------------------------------------
137typedef unsigned short XMLUInt16;
138typedef unsigned int   XMLUInt32;
139
140// ---------------------------------------------------------------------------
141//  Define signed 32 bits integers
142// ---------------------------------------------------------------------------
143typedef int            XMLInt32;
144
145// ---------------------------------------------------------------------------
146//  XMLSize_t is the unsigned integral type.
147// ---------------------------------------------------------------------------
148#if defined(_SIZE_T) && defined(SIZE_MAX) && defined(_SSIZE_T) && defined(SSIZE_MAX)
149    typedef size_t              XMLSize_t;
150    #define XML_SIZE_MAX        SIZE_MAX
151    typedef ssize_t             XMLSSize_t;
152    #define XML_SSIZE_MAX       SSIZE_MAX
153#else
154    typedef unsigned long       XMLSize_t;
155    #define XML_SIZE_MAX        ULONG_MAX
156    typedef long                XMLSSize_t;
157    #define XML_SSIZE_MAX       LONG_MAX
158#endif
159
160// ---------------------------------------------------------------------------
161//  Force on the Xerces debug token if it was on in the build environment
162// ---------------------------------------------------------------------------
163#if defined(_DEBUG)
164#define XERCES_DEBUG
165#endif
166
167
168// ---------------------------------------------------------------------------
169//  Provide some common string ops that are different/notavail on MVSCPP
170// ---------------------------------------------------------------------------
171
172//
173// This is a upper casing function. Note that this will not cover
174// all NLS cases such as European accents etc. but there aren't
175// any of these in the current uses of this function in Xerces.
176// If this changes in the future, than we can re-address the issue
177// at that time.
178//
179inline char mytoupper(const char toUpper)
180{
181    if ((toUpper >= 0x61) && (toUpper <= 0x7A))
182        return char(toUpper - 0x20);
183    return toUpper;
184}
185
186inline char mytolower(const char toLower)
187{
188    if ((toLower >= 0x41) && (toLower <= 0x5A))
189        return char(toLower + 0x20);
190    return toLower;
191}
192
193inline XMLCh mytowupper(const XMLCh toUpper)
194{
195    if ((toUpper >= 0x61) && (toUpper <= 0x7A))
196       return XMLCh(toUpper - 0x20);
197    return toUpper;
198}
199
200inline XMLCh mytowlower(const XMLCh toLower)
201{
202    if ((toLower >= 0x41) && (toLower <= 0x5A))
203       return XMLCh(toLower + 0x20);
204    return toLower;
205}
206
207int stricmp(const char* const str1, const char* const  str2);
208int strnicmp(const char* const str1, const char* const  str2, const unsigned int count);
209
210
211
212// ---------------------------------------------------------------------------
213//  The name of the DLL that is built by the MVSCPP version of the system.
214// ---------------------------------------------------------------------------
215const char* const Xerces_DLLName = "libxerces-c";
216
217#endif  // MVSCPPDEFS_HPP
Note: See TracBrowser for help on using the repository browser.