1 | /* |
---|
2 | * Licensed to the Apache Software Foundation (ASF) under one or more |
---|
3 | * contributor license agreements. See the NOTICE file distributed with |
---|
4 | * this work for additional information regarding copyright ownership. |
---|
5 | * The ASF licenses this file to You under the Apache License, Version 2.0 |
---|
6 | * (the "License"); you may not use this file except in compliance with |
---|
7 | * the License. You may obtain a copy of the License at |
---|
8 | * |
---|
9 | * http://www.apache.org/licenses/LICENSE-2.0 |
---|
10 | * |
---|
11 | * Unless required by applicable law or agreed to in writing, software |
---|
12 | * distributed under the License is distributed on an "AS IS" BASIS, |
---|
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
---|
14 | * See the License for the specific language governing permissions and |
---|
15 | * limitations under the License. |
---|
16 | */ |
---|
17 | |
---|
18 | /* |
---|
19 | * $Id: SunCCDefs.hpp 568078 2007-08-21 11:43:25Z amassari $ |
---|
20 | */ |
---|
21 | |
---|
22 | #if !defined(SUNCCDEFS_HPP) |
---|
23 | #define SUNCCDEFS_HPP |
---|
24 | |
---|
25 | // --------------------------------------------------------------------------- |
---|
26 | // Include some runtime files that will be needed product wide |
---|
27 | // --------------------------------------------------------------------------- |
---|
28 | #include <sys/types.h> // for size_t and ssize_t |
---|
29 | #include <limits.h> // for MAX of size_t and ssize_t |
---|
30 | |
---|
31 | // --------------------------------------------------------------------------- |
---|
32 | // A define in the build for each project is also used to control whether |
---|
33 | // the export keyword is from the project's viewpoint or the client's. |
---|
34 | // These defines provide the platform specific keywords that they need |
---|
35 | // to do this. |
---|
36 | // --------------------------------------------------------------------------- |
---|
37 | #define PLATFORM_EXPORT |
---|
38 | #define PLATFORM_IMPORT |
---|
39 | |
---|
40 | // --------------------------------------------------------------------------- |
---|
41 | // Indicate that we do not support native bools |
---|
42 | // If the compiler can handle boolean itself, do not define it |
---|
43 | // --------------------------------------------------------------------------- |
---|
44 | #if !defined(_BOOL) |
---|
45 | #define NO_NATIVE_BOOL |
---|
46 | #endif |
---|
47 | |
---|
48 | // --------------------------------------------------------------------------- |
---|
49 | // Each compiler might support L"" prefixed constants. There are places |
---|
50 | // where it is advantageous to use the L"" where it supported, to avoid |
---|
51 | // unnecessary transcoding. |
---|
52 | // If your compiler does not support it, don't define this. |
---|
53 | // --------------------------------------------------------------------------- |
---|
54 | // #define XML_LSTRSUPPORT |
---|
55 | |
---|
56 | // --------------------------------------------------------------------------- |
---|
57 | // Indicate that we support C++ namespace |
---|
58 | // Do not define it if the compile cannot handle C++ namespace |
---|
59 | // --------------------------------------------------------------------------- |
---|
60 | #define XERCES_HAS_CPP_NAMESPACE |
---|
61 | |
---|
62 | // --------------------------------------------------------------------------- |
---|
63 | // Define our version of the XML character |
---|
64 | // --------------------------------------------------------------------------- |
---|
65 | typedef unsigned short XMLCh; |
---|
66 | |
---|
67 | // --------------------------------------------------------------------------- |
---|
68 | // Define unsigned 16 and 32 bits integers |
---|
69 | // --------------------------------------------------------------------------- |
---|
70 | typedef unsigned short XMLUInt16; |
---|
71 | typedef unsigned int XMLUInt32; |
---|
72 | |
---|
73 | // --------------------------------------------------------------------------- |
---|
74 | // Define signed 32 bits integers |
---|
75 | // --------------------------------------------------------------------------- |
---|
76 | typedef int XMLInt32; |
---|
77 | |
---|
78 | // --------------------------------------------------------------------------- |
---|
79 | // XMLSize_t is the unsigned integral type. |
---|
80 | // --------------------------------------------------------------------------- |
---|
81 | #if defined(_SIZE_T) && defined(SIZE_MAX) && defined(_SSIZE_T) && defined(SSIZE_MAX) |
---|
82 | typedef size_t XMLSize_t; |
---|
83 | #define XML_SIZE_MAX SIZE_MAX |
---|
84 | typedef ssize_t XMLSSize_t; |
---|
85 | #define XML_SSIZE_MAX SSIZE_MAX |
---|
86 | #else |
---|
87 | typedef unsigned long XMLSize_t; |
---|
88 | #define XML_SIZE_MAX ULONG_MAX |
---|
89 | typedef long XMLSSize_t; |
---|
90 | #define XML_SSIZE_MAX LONG_MAX |
---|
91 | #endif |
---|
92 | |
---|
93 | |
---|
94 | // --------------------------------------------------------------------------- |
---|
95 | // Force on the Xerces debug token if it was on in the build environment |
---|
96 | // --------------------------------------------------------------------------- |
---|
97 | #if defined(_DEBUG) |
---|
98 | #define XERCES_DEBUG |
---|
99 | #endif |
---|
100 | |
---|
101 | #if __SUNPRO_CC >= 0x500 |
---|
102 | #define XERCES_NEW_IOSTREAMS |
---|
103 | #define XERCES_STD_NAMESPACE |
---|
104 | #endif |
---|
105 | |
---|
106 | // --------------------------------------------------------------------------- |
---|
107 | // Provide some common string ops that are different/notavail on CC |
---|
108 | // --------------------------------------------------------------------------- |
---|
109 | inline char toupper(const char toUpper) |
---|
110 | { |
---|
111 | if ((toUpper >= 'a') && (toUpper <= 'z')) |
---|
112 | return char(toUpper - 0x20); |
---|
113 | return toUpper; |
---|
114 | } |
---|
115 | |
---|
116 | inline char tolower(const char toLower) |
---|
117 | { |
---|
118 | if ((toLower >= 'A') && (toLower <= 'Z')) |
---|
119 | return char(toLower + 0x20); |
---|
120 | return toLower; |
---|
121 | } |
---|
122 | |
---|
123 | int stricmp(const char* const str1, const char* const str2); |
---|
124 | int strnicmp(const char* const str1, const char* const str2, const unsigned int count); |
---|
125 | |
---|
126 | |
---|
127 | // --------------------------------------------------------------------------- |
---|
128 | // The name of the DLL that is built by the CC version of the system. |
---|
129 | // --------------------------------------------------------------------------- |
---|
130 | const char* const Xerces_DLLName = "libxerces-c"; |
---|
131 | |
---|
132 | #endif // SUNCCDEFS_HPP |
---|