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

Revision 2674, 5.7 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: GCCDefs.hpp 568078 2007-08-21 11:43:25Z amassari $
20 */
21
22#if !defined(GCCDEFS_HPP)
23#define GCCDEFS_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#if defined(__MINGW32__) && !defined (XML_LIBRARY)
38#define PLATFORM_EXPORT __declspec(dllexport)
39#define PLATFORM_IMPORT __declspec(dllimport)
40#else
41#define PLATFORM_EXPORT
42#define PLATFORM_IMPORT
43#endif
44
45// ---------------------------------------------------------------------------
46//  Indicate that we do not support native bools
47//  If the compiler can handle boolean itself, do not define it
48// ---------------------------------------------------------------------------
49// #define NO_NATIVE_BOOL
50
51// ---------------------------------------------------------------------------
52//  Each compiler might support L"" prefixed constants. There are places
53//  where it is advantageous to use the L"" where it supported, to avoid
54//  unnecessary transcoding.
55//  If your compiler does not support it, don't define this.
56// ---------------------------------------------------------------------------
57// #define XML_LSTRSUPPORT
58
59// ---------------------------------------------------------------------------
60//  Indicate that we support C++ namespace
61//  Do not define it if the compile cannot handle C++ namespace
62// ---------------------------------------------------------------------------
63#define XERCES_HAS_CPP_NAMESPACE
64
65// ---------------------------------------------------------------------------
66//  Define our version of the XML character
67// ---------------------------------------------------------------------------
68#if defined(__MINGW32__) && defined(_WCHAR_T_DEFINED)
69typedef wchar_t         XMLCh;
70#else
71typedef unsigned short  XMLCh;
72#endif
73
74// ---------------------------------------------------------------------------
75//  Define unsigned 16 and 32 bits integers
76// ---------------------------------------------------------------------------
77typedef unsigned short  XMLUInt16;
78typedef unsigned int    XMLUInt32;
79
80// ---------------------------------------------------------------------------
81//  Define signed 32 bits integers
82// ---------------------------------------------------------------------------
83typedef int             XMLInt32;
84
85// ---------------------------------------------------------------------------
86//  XMLSize_t is the unsigned integral type.
87// ---------------------------------------------------------------------------
88#if defined(_SIZE_T) && defined(SIZE_MAX) && defined(_SSIZE_T) && defined(SSIZE_MAX)
89    typedef size_t              XMLSize_t;
90    #define XML_SIZE_MAX        SIZE_MAX
91    typedef ssize_t             XMLSSize_t;
92    #define XML_SSIZE_MAX       SSIZE_MAX
93#else
94    typedef unsigned long       XMLSize_t;
95    #define XML_SIZE_MAX        ULONG_MAX
96    typedef long                XMLSSize_t;
97    #define XML_SSIZE_MAX       LONG_MAX
98#endif
99
100// ---------------------------------------------------------------------------
101//  Force on the Xerces debug token if it was on in the build environment
102// ---------------------------------------------------------------------------
103#if defined(_DEBUG)
104#define XERCES_DEBUG
105#endif
106
107#if __GNUC__ >= 3
108#define XERCES_NEW_IOSTREAMS
109#define XERCES_STD_NAMESPACE
110#endif
111
112// ---------------------------------------------------------------------------
113//  Provide some common string ops that are different/notavail on GCC
114// ---------------------------------------------------------------------------
115#if !defined(XML_TRU64) && !defined(XML_GCC)
116inline char toupper(const char toUpper)
117{
118    if ((toUpper >= 'a') && (toUpper <= 'z'))
119        return char(toUpper - 0x20);
120    return toUpper;
121}
122
123inline char tolower(const char toLower)
124{
125    if ((toLower >= 'A') && (toLower <= 'Z'))
126        return char(toLower + 0x20);
127    return toLower;
128}
129#endif
130
131#if !defined(__CYGWIN__) && !defined(__MINGW32__)
132
133int stricmp(const char* const str1, const char* const  str2);
134int strnicmp(const char* const str1, const char* const  str2, const unsigned int count);
135
136#endif // ! __CYGWIN__
137
138
139// ---------------------------------------------------------------------------
140//  The name of the DLL that is built by the GCC version of the system.
141// ---------------------------------------------------------------------------
142const char* const Xerces_DLLName = "libxerces-c";
143
144#endif  // GCCDEFS_HPP
145
Note: See TracBrowser for help on using the repository browser.