00001 /* 00002 * Licensed to the Apache Software Foundation (ASF) under one or more 00003 * contributor license agreements. See the NOTICE file distributed with 00004 * this work for additional information regarding copyright ownership. 00005 * The ASF licenses this file to You under the Apache License, Version 2.0 00006 * (the "License"); you may not use this file except in compliance with 00007 * the License. You may obtain a copy of the License at 00008 * 00009 * http://www.apache.org/licenses/LICENSE-2.0 00010 * 00011 * Unless required by applicable law or agreed to in writing, software 00012 * distributed under the License is distributed on an "AS IS" BASIS, 00013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00014 * See the License for the specific language governing permissions and 00015 * limitations under the License. 00016 */ 00017 00018 /* 00019 * $Id: XercesDefs.hpp 932887 2010-04-11 13:04:59Z borisk $ 00020 */ 00021 00022 #if !defined(XERCESC_INCLUDE_GUARD_XERCESDEFS_HPP) 00023 #define XERCESC_INCLUDE_GUARD_XERCESDEFS_HPP 00024 00025 // --------------------------------------------------------------------------- 00026 // The file xerces_hdr_config defines critical configuration information 00027 // used by the remainder of this file. 00028 // 00029 // There are two major configuration files: 00030 // - xerces_autoconf_config.hpp-- Contains defines that are safe for 00031 // access through public headers. 00032 // 00033 // - config.h -- Contains defines that may conflict 00034 // with other packages; should only be 00035 // included by Xerces implementation files. 00036 // 00037 // Both of these files are generated through the autoconf/configure process. 00038 // --------------------------------------------------------------------------- 00039 00040 // 00041 // If this is an autoconf configured build, we include Xerces_autoconf_config.hpp 00042 // Otherwise we include a preconfigured config appropriate for the particular 00043 // platform that the specific makefile should copy over. 00044 // 00045 // If the next line generates an error then you haven't run ./configure 00046 #include <xercesc/util/Xerces_autoconf_config.hpp> 00047 00048 // --------------------------------------------------------------------------- 00049 // Include the Xerces version information; this is kept in a separate file to 00050 // make modification simple and obvious. Updates to the version header file 00051 // --------------------------------------------------------------------------- 00052 #include <xercesc/util/XercesVersion.hpp> 00053 00054 00055 // --------------------------------------------------------------------------- 00056 // Some general typedefs that are defined for internal flexibility. 00057 // 00058 // Note that UTF16Ch is fixed at 16 bits, whereas XMLCh floats in size per 00059 // platform, to whatever is the native wide char format there. UCS4Ch is 00060 // fixed at 32 bits. The types we defined them in terms of are defined per 00061 // compiler, using whatever types are the right ones for them to get these 00062 // 16/32 bit sizes. 00063 // 00064 // --------------------------------------------------------------------------- 00065 typedef unsigned char XMLByte; 00066 typedef XMLUInt16 UTF16Ch; 00067 typedef XMLUInt32 UCS4Ch; 00068 00069 00070 // --------------------------------------------------------------------------- 00071 // Handle boolean. If the platform can handle booleans itself, then we 00072 // map our boolean type to the native type. Otherwise we create a default 00073 // one as an int and define const values for true and false. 00074 // 00075 // This flag will be set in the per-development environment stuff above. 00076 // --------------------------------------------------------------------------- 00077 #if defined(XERCES_NO_NATIVE_BOOL) 00078 #ifndef bool 00079 typedef int bool; 00080 #endif 00081 #ifndef true 00082 #define true 1 00083 #endif 00084 #ifndef false 00085 #define false 0 00086 #endif 00087 #endif 00088 00089 // --------------------------------------------------------------------------- 00090 // According to whether the compiler supports L"" type strings, we define 00091 // the XMLStrL() macro one way or another. 00092 // --------------------------------------------------------------------------- 00093 #if defined(XERCES_LSTRSUPPORT) 00094 #define XMLStrL(str) L##str 00095 #else 00096 #define XMLStrL(str) str 00097 #endif 00098 00099 00100 // --------------------------------------------------------------------------- 00101 // Define namespace symbols if the compiler supports it. 00102 // --------------------------------------------------------------------------- 00103 #if defined(XERCES_HAS_CPP_NAMESPACE) 00104 #define XERCES_CPP_NAMESPACE_BEGIN namespace XERCES_CPP_NAMESPACE { 00105 #define XERCES_CPP_NAMESPACE_END } 00106 #define XERCES_CPP_NAMESPACE_USE using namespace XERCES_CPP_NAMESPACE; 00107 #define XERCES_CPP_NAMESPACE_QUALIFIER XERCES_CPP_NAMESPACE:: 00108 00109 namespace XERCES_CPP_NAMESPACE { } 00110 namespace xercesc = XERCES_CPP_NAMESPACE; 00111 #else 00112 #define XERCES_CPP_NAMESPACE_BEGIN 00113 #define XERCES_CPP_NAMESPACE_END 00114 #define XERCES_CPP_NAMESPACE_USE 00115 #define XERCES_CPP_NAMESPACE_QUALIFIER 00116 #endif 00117 00118 #if defined(XERCES_STD_NAMESPACE) 00119 #define XERCES_USING_STD(NAME) using std :: NAME; 00120 #define XERCES_STD_QUALIFIER std :: 00121 #else 00122 #define XERCES_USING_STD(NAME) 00123 #define XERCES_STD_QUALIFIER 00124 #endif 00125 00126 00127 // --------------------------------------------------------------------------- 00128 // Set up the import/export keyword for our core projects. The 00129 // PLATFORM_XXXX keywords are set in the per-development environment 00130 // include above. 00131 // --------------------------------------------------------------------------- 00132 00133 // The DLL_EXPORT flag should be defined on the command line during the build of a DLL 00134 // configure conspires to make this happen. 00135 00136 #if defined(DLL_EXPORT) 00137 #if defined(XERCES_BUILDING_LIBRARY) 00138 #define XMLUTIL_EXPORT XERCES_PLATFORM_EXPORT 00139 #define XMLPARSER_EXPORT XERCES_PLATFORM_EXPORT 00140 #define SAX_EXPORT XERCES_PLATFORM_EXPORT 00141 #define SAX2_EXPORT XERCES_PLATFORM_EXPORT 00142 #define CDOM_EXPORT XERCES_PLATFORM_EXPORT 00143 #define PARSERS_EXPORT XERCES_PLATFORM_EXPORT 00144 #define VALIDATORS_EXPORT XERCES_PLATFORM_EXPORT 00145 #define XINCLUDE_EXPORT XERCES_PLATFORM_EXPORT 00146 #else 00147 #define XMLUTIL_EXPORT XERCES_PLATFORM_IMPORT 00148 #define XMLPARSER_EXPORT XERCES_PLATFORM_IMPORT 00149 #define SAX_EXPORT XERCES_PLATFORM_IMPORT 00150 #define SAX2_EXPORT XERCES_PLATFORM_IMPORT 00151 #define CDOM_EXPORT XERCES_PLATFORM_IMPORT 00152 #define PARSERS_EXPORT XERCES_PLATFORM_IMPORT 00153 #define VALIDATORS_EXPORT XERCES_PLATFORM_IMPORT 00154 #define XINCLUDE_EXPORT XERCES_PLATFORM_IMPORT 00155 #endif 00156 #if defined(XERCES_BUILDING_DEPRECATED_LIBRARY) 00157 #define DEPRECATED_DOM_EXPORT XERCES_PLATFORM_EXPORT 00158 #else 00159 #define DEPRECATED_DOM_EXPORT XERCES_PLATFORM_IMPORT 00160 #endif 00161 #else 00162 #define XMLUTIL_EXPORT 00163 #define XMLPARSER_EXPORT 00164 #define SAX_EXPORT 00165 #define SAX2_EXPORT 00166 #define CDOM_EXPORT 00167 #define DEPRECATED_DOM_EXPORT 00168 #define PARSERS_EXPORT 00169 #define VALIDATORS_EXPORT 00170 #define XINCLUDE_EXPORT 00171 #endif 00172 00173 #endif