Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

XSECDefs.hpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 2002-2005 The Apache Software Foundation.
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 /*
00018  * XSEC
00019  *
00020  * XSECDefs := File for general XSEC definitions
00021  *
00022  * Author(s): Berin Lautenbach
00023  *
00024  * $Id: XSECDefs.hpp 450286 2006-09-27 01:47:51Z blautenb $
00025  *
00026  */
00027 
00028 // Use Xerces to do the "hard work in determining compilers etc." for us
00029 
00030 #ifndef XSECDEFS_HEADER
00031 #define XSECDEFS_HEADER
00032 
00033 // General includes
00034 
00035 #include <assert.h>
00036 #include <stdlib.h>
00037 
00038 // Include the generated include file
00039 
00040 #if defined (_WIN32)
00041 #   include <xsec/framework/XSECW32Config.hpp>
00042 #   if defined (_DEBUG) && defined (_XSEC_DO_MEMDEBUG)
00043 #       define _CRTDBG_MAP_ALLOC
00044 #       include <crtdbg.h>
00045 #   endif
00046 #   define WIN32_LEAN_AND_MEAN
00047 #   include <windows.h>
00048 #else
00049 #   include <xsec/framework/XSECConfig.hpp>
00050 #endif
00051 
00052 // Xalan
00053 
00054 //#include <Include/PlatformDefinitions.hpp>
00055 
00056 // Xerces
00057 
00058 #include <xercesc/util/XercesDefs.hpp>
00059 
00060 // --------------------------------------------------------------------------------
00061 //           Namespace Handling
00062 // --------------------------------------------------------------------------------
00063 
00064 // Use an approach similar to that used in Xalan to process Xerces namespaces
00065 
00066 #if defined(XERCES_HAS_CPP_NAMESPACE)
00067 #   define XSEC_USING_XERCES(NAME) using XERCES_CPP_NAMESPACE :: NAME
00068 #   define XSEC_DECLARE_XERCES_CLASS(NAME) namespace XERCES_CPP_NAMESPACE { class NAME; }
00069 #   define XSEC_DECLARE_XERCES_STRUCT(NAME) namespace XERCES_CPP_NAMESPACE { struct NAME; }
00070 #else
00071 #   define XERCES_CPP_NAMESPACE_QUALIFIER
00072 #   define XERCES_CPP_NAMESPACE_BEGIN
00073 #   define XERCES_CPP_NAMESPACE_END
00074 #   define XERCES_CPP_NAMESPACE_USE
00075 #   define XSEC_USING_XERCES(NAME)
00076 #   define XSEC_DECLARE_XERCES_CLASS(NAME) class NAME;
00077 #   define XSEC_DECLARE_XERCES_STRUCT(NAME) struct NAME;
00078 #endif
00079 
00080 #if defined (XSEC_XERCES_XMLSTRING_HAS_RELEASE)
00081 #    define XSEC_RELEASE_XMLCH(x) XMLString::release(&x)
00082 #else
00083 #    define XSEC_RELEASE_XMLCH(x) delete[] x;
00084 #endif
00085 
00086 // --------------------------------------------------------------------------------
00087 //           Project Library Handling
00088 // --------------------------------------------------------------------------------
00089 
00090 #if defined (PLATFORM_EXPORT)
00091 #  define XSEC_PLATFORM_EXPORT PLATFORM_EXPORT
00092 #  define XSEC_PLATFORM_IMPORT PLATFORM_IMPORT
00093 #else
00094 #  define XSEC_PLATFORM_EXPORT XERCES_PLATFORM_EXPORT
00095 #  define XSEC_PLATFORM_IMPORT XERCES_PLATFORM_IMPORT
00096 #endif
00097 
00098 #if defined (PROJ_CANON)
00099 
00100 #define CANON_EXPORT XSEC_PLATFORM_EXPORT
00101 #else
00102 #define CANON_EXPORT XSEC_PLATFORM_IMPORT
00103 #endif
00104 
00105 #if defined (PROJ_DSIG)
00106 
00107 #define DSIG_EXPORT XSEC_PLATFORM_EXPORT
00108 #else
00109 #define DSIG_EXPORT XSEC_PLATFORM_IMPORT
00110 #endif
00111 
00112 // Platform includes.  Much of this is taken from Xalan
00113 
00114 #if defined(_MSC_VER)
00115 
00116 // Microsoft VC++
00117 
00118 #   pragma warning(disable: 4127 4251 4511 4503 4512 4514 4702 4710 4711 4786 4097; error: 4150 4172 4238 4239 4715)
00119 #   define XSEC_NO_COVARIANT_RETURN_TYPE
00120 /*
00121  * Removed to allow any compiler to compile - might not work, but ....
00122  * #elif defined(__GNUC__)
00123  * #elif defined(__INTEL_COMPILER)
00124  * #else
00125  * #error Unknown compiler.
00126  */
00127 #endif
00128 
00129 
00130 // Configuration includes
00131 
00132 // We want to use XPath calculated transforms
00133 
00134 //#define XSEC_USE_XPATH_ENVELOPE
00135 
00136 
00137 // Given the configuration - what should we set?
00138 
00139 #ifdef XSEC_NO_XALAN
00140 
00141 // Xalan is not available!
00142 
00143 #   define XSEC_NO_XPATH
00144 #   define XSEC_NO_XSLT
00145 
00146 #endif  /* XSEC_NO_XALAN */
00147 
00148 #ifdef XSEC_NO_XPATH
00149 
00150 #   ifdef XSEC_USE_XPATH_ENVELOPE
00151 #       undef XSEC_USE_XPATH_ENVELOPE
00152 #   endif
00153 
00154 #endif
00155 
00156 
00157 /*
00158  * The following definitions are *only* made if we are
00159  * building library code to make sure we don't interfere
00160  * with the way apps are doing things
00161  */
00162 
00163 #ifdef XSEC_LIBRARY_BUILD
00164 
00165 #    ifndef XSEC_HAVE__STRDUP
00166 #        define _strdup(x) strdup(x)
00167 #    endif
00168 
00169 #    ifndef XSEC_HAVE__STRICMP
00170 #        ifdef XSEC_HAVE_STRICMP
00171 #            define _stricmp(x,y) stricmp(x,y)
00172 #        else
00173 #            ifdef XSEC_HAVE_STRCASECMP
00174 #                define _stricmp(x,y) strcasecmp(x,y)
00175 #            endif
00176 #        endif
00177 #    endif
00178 
00179 #    ifndef XSEC_HAVE__GETCWD
00180 #        define _getcwd(x,y) getcwd(x,y)
00181 #    endif
00182 
00183 #endif
00184 
00185 #endif /* XSECDEFS_HEADER */

Generated on Sun Jan 28 19:37:24 2007 for XML-Security-C by  doxygen 1.4.2