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