source: NonGTP/Xerces/xerces-c_2_8_0/include/xercesc/util/Compilers/MVSCPPDefs.hpp @ 2674

Revision 2674, 5.9 KB checked in by mattausch, 16 years ago (diff)
Line 
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: MVSCPPDefs.hpp 568078 2007-08-21 11:43:25Z amassari $
20 */
21
22#if !defined(MVSCPPDEFS_HPP)
23#define MVSCPPDEFS_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 _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//#define NO_NATIVE_BOOL
45
46// ---------------------------------------------------------------------------
47//  Each compiler might support L"" prefixed constants. There are places
48//  where it is advantageous to use the L"" where it supported, to avoid
49//  unnecessary transcoding.
50//  If your compiler does not support it, don't define this.
51// ---------------------------------------------------------------------------
52#define XML_LSTRSUPPORT
53
54// ---------------------------------------------------------------------------
55//  Indicate that we support C++ namespace
56//  Do not define it if the compile cannot handle C++ namespace
57// ---------------------------------------------------------------------------
58#define XERCES_HAS_CPP_NAMESPACE
59
60// ---------------------------------------------------------------------------
61//  Define our version of the XML character
62// ---------------------------------------------------------------------------
63typedef unsigned short XMLCh;
64// typedef wchar_t XMLCh;
65
66// ---------------------------------------------------------------------------
67//  Define unsigned 16 and 32 bits integers
68// ---------------------------------------------------------------------------
69typedef unsigned short XMLUInt16;
70typedef unsigned int   XMLUInt32;
71
72// ---------------------------------------------------------------------------
73//  Define signed 32 bits integers
74// ---------------------------------------------------------------------------
75typedef int            XMLInt32;
76
77// ---------------------------------------------------------------------------
78//  XMLSize_t is the unsigned integral type.
79// ---------------------------------------------------------------------------
80#if defined(_SIZE_T) && defined(SIZE_MAX) && defined(_SSIZE_T) && defined(SSIZE_MAX)
81    typedef size_t              XMLSize_t;
82    #define XML_SIZE_MAX        SIZE_MAX
83    typedef ssize_t             XMLSSize_t;
84    #define XML_SSIZE_MAX       SSIZE_MAX
85#else
86    typedef unsigned long       XMLSize_t;
87    #define XML_SIZE_MAX        ULONG_MAX
88    typedef long                XMLSSize_t;
89    #define XML_SSIZE_MAX       LONG_MAX
90#endif
91
92// ---------------------------------------------------------------------------
93//  Force on the Xerces debug token if it was on in the build environment
94// ---------------------------------------------------------------------------
95#if defined(_DEBUG)
96#define XERCES_DEBUG
97#endif
98
99
100// ---------------------------------------------------------------------------
101//  Provide some common string ops that are different/notavail on MVSCPP
102// ---------------------------------------------------------------------------
103
104//
105// This is a upper casing function. Note that this will not cover
106// all NLS cases such as European accents etc. but there aren't
107// any of these in the current uses of this function in Xerces.
108// If this changes in the future, than we can re-address the issue
109// at that time.
110//
111inline char mytoupper(const char toUpper)
112{
113    if ((toUpper >= 0x61) && (toUpper <= 0x7A))
114        return char(toUpper - 0x20);
115    return toUpper;
116}
117
118inline char mytolower(const char toLower)
119{
120    if ((toLower >= 0x41) && (toLower <= 0x5A))
121        return char(toLower + 0x20);
122    return toLower;
123}
124
125inline XMLCh mytowupper(const XMLCh toUpper)
126{
127    if ((toUpper >= 0x61) && (toUpper <= 0x7A))
128       return XMLCh(toUpper - 0x20);
129    return toUpper;
130}
131
132inline XMLCh mytowlower(const XMLCh toLower)
133{
134    if ((toLower >= 0x41) && (toLower <= 0x5A))
135       return XMLCh(toLower + 0x20);
136    return toLower;
137}
138
139int stricmp(const char* const str1, const char* const  str2);
140int strnicmp(const char* const str1, const char* const  str2, const unsigned int count);
141
142
143
144// ---------------------------------------------------------------------------
145//  The name of the DLL that is built by the MVSCPP version of the system.
146// ---------------------------------------------------------------------------
147const char* const Xerces_DLLName = "libxerces-c";
148
149#endif  // MVSCPPDEFS_HPP
Note: See TracBrowser for help on using the repository browser.