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 | * $Id: CodeWarriorDefs.hpp,v 1.13 2004/09/08 13:56:32 peiyongz Exp $
|
---|
19 | */
|
---|
20 |
|
---|
21 | #if !defined(CODEWARRIORDEFS_HPP)
|
---|
22 | #define CODEWARRIORDEFS_HPP
|
---|
23 |
|
---|
24 | // ---------------------------------------------------------------------------
|
---|
25 | // Include some runtime files that will be needed product wide
|
---|
26 | // ---------------------------------------------------------------------------
|
---|
27 | //#include <sys/types.h> // for size_t and ssize_t
|
---|
28 | //#include <limits.h> // for MAX of size_t and ssize_t
|
---|
29 | //#include <extras.h>
|
---|
30 |
|
---|
31 | #if defined(_WIN32) || defined(WIN32)
|
---|
32 | #include <wchar.h>
|
---|
33 | #include <wctype.h>
|
---|
34 | #endif
|
---|
35 |
|
---|
36 |
|
---|
37 | // ---------------------------------------------------------------------------
|
---|
38 | // A define in the build for each project is also used to control whether
|
---|
39 | // the export keyword is from the project's viewpoint or the client's.
|
---|
40 | // These defines provide the platform specific keywords that they need
|
---|
41 | // to do this.
|
---|
42 | // ---------------------------------------------------------------------------
|
---|
43 | #if defined(XML_MACOS)
|
---|
44 | #define PLATFORM_EXPORT __declspec(export)
|
---|
45 | #define PLATFORM_IMPORT __declspec(import)
|
---|
46 | #elif defined(_WIN32) || defined(WIN32)
|
---|
47 | #define PLATFORM_EXPORT __declspec(dllexport)
|
---|
48 | #define PLATFORM_IMPORT __declspec(dllimport)
|
---|
49 | #endif
|
---|
50 |
|
---|
51 | // ---------------------------------------------------------------------------
|
---|
52 | // Indicate that we do not support native bools
|
---|
53 | // If the compiler can handle boolean itself, do not define it
|
---|
54 | // ---------------------------------------------------------------------------
|
---|
55 | // #define NO_NATIVE_BOOL
|
---|
56 |
|
---|
57 | // ---------------------------------------------------------------------------
|
---|
58 | // Each compiler might support L"" prefixed constants. There are places
|
---|
59 | // where it is advantageous to use the L"" where it supported, to avoid
|
---|
60 | // unnecessary transcoding.
|
---|
61 | // If your compiler does not support it, don't define this.
|
---|
62 | // ---------------------------------------------------------------------------
|
---|
63 | #define XML_LSTRSUPPORT
|
---|
64 |
|
---|
65 | // ---------------------------------------------------------------------------
|
---|
66 | // Indicate that we support C++ namespace
|
---|
67 | // Do not define it if the compile cannot handle C++ namespace
|
---|
68 | // ---------------------------------------------------------------------------
|
---|
69 | #define XERCES_HAS_CPP_NAMESPACE
|
---|
70 |
|
---|
71 | // ---------------------------------------------------------------------------
|
---|
72 | // Define our version of the XML character
|
---|
73 | // ---------------------------------------------------------------------------
|
---|
74 | #if defined(XML_MACOS)
|
---|
75 | typedef unsigned short XMLCh;
|
---|
76 | #elif defined(_WIN32) || defined(WIN32)
|
---|
77 | typedef wchar_t XMLCh;
|
---|
78 | #endif
|
---|
79 |
|
---|
80 | // ---------------------------------------------------------------------------
|
---|
81 | // Define unsigned 16 and 32 bits integers
|
---|
82 | // ---------------------------------------------------------------------------
|
---|
83 | typedef unsigned short XMLUInt16;
|
---|
84 | typedef unsigned int XMLUInt32;
|
---|
85 |
|
---|
86 | // ---------------------------------------------------------------------------
|
---|
87 | // Define signed 32 bits integers
|
---|
88 | // ---------------------------------------------------------------------------
|
---|
89 | typedef int XMLInt32;
|
---|
90 |
|
---|
91 | // ---------------------------------------------------------------------------
|
---|
92 | // XMLSize_t is the unsigned integral type.
|
---|
93 | // ---------------------------------------------------------------------------
|
---|
94 | #if defined(_SIZE_T) && defined(SIZE_MAX) && defined(_SSIZE_T) && defined(SSIZE_MAX)
|
---|
95 | typedef size_t XMLSize_t;
|
---|
96 | #define XML_SIZE_MAX SIZE_MAX
|
---|
97 | typedef ssize_t XMLSSize_t;
|
---|
98 | #define XML_SSIZE_MAX SSIZE_MAX
|
---|
99 | #else
|
---|
100 | typedef unsigned long XMLSize_t;
|
---|
101 | #define XML_SIZE_MAX ULONG_MAX
|
---|
102 | typedef long XMLSSize_t;
|
---|
103 | #define XML_SSIZE_MAX LONG_MAX
|
---|
104 | #endif
|
---|
105 |
|
---|
106 | // ---------------------------------------------------------------------------
|
---|
107 | // Force on the Xerces debug token if it was on in the build environment
|
---|
108 | // ---------------------------------------------------------------------------
|
---|
109 | #ifdef _DEBUG
|
---|
110 | #define XERCES_DEBUG
|
---|
111 | #endif
|
---|
112 |
|
---|
113 | // ---------------------------------------------------------------------------
|
---|
114 | // Provide some common string ops that are different/notavail for CodeWarrior.
|
---|
115 | // (these routines are defined in CW 8 by extras.h, but there is no MachO
|
---|
116 | // library for extras).
|
---|
117 | // ---------------------------------------------------------------------------
|
---|
118 | #if __MACH__
|
---|
119 | int stricmp(const char* const str1, const char* const str2);
|
---|
120 | int strnicmp(const char* const str1, const char* const str2, const unsigned int count);
|
---|
121 | #endif
|
---|
122 |
|
---|
123 | #if defined(_WIN32) || defined(WIN32)
|
---|
124 | /* used in place of calling mbstowcs or wcstombs with a NULL destination */
|
---|
125 | int mbswcslen(const char * s, const unsigned int n);
|
---|
126 | int wcsmbslen(const wchar_t * pwcs, const unsigned int n);
|
---|
127 | #endif
|
---|
128 |
|
---|
129 | // ---------------------------------------------------------------------------
|
---|
130 | // The name of the DLL that is built by the Codewarrior version of the
|
---|
131 | // system. We append a previously defined token which holds the DLL
|
---|
132 | // versioning string. This is defined in XercesDefs.hpp which is what this
|
---|
133 | // file is included into.
|
---|
134 | // ---------------------------------------------------------------------------
|
---|
135 | const char* const Xerces_DLLName = "xerces-c" Xerces_DLLVersionStr;
|
---|
136 |
|
---|
137 | #endif //CODEWARRIORDEFS_HPP
|
---|