source: NonGTP/Xerces/xercesc/util/XercesVersion.hpp @ 188

Revision 188, 10.5 KB checked in by mattausch, 19 years ago (diff)

added xercesc to support

Line 
1/*
2 * The Apache Software License, Version 1.1
3 *
4 * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights
5 * reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 *
11 * 1. Redistributions of source code must retain the above copyright
12 *    notice, this list of conditions and the following disclaimer.
13 *
14 * 2. Redistributions in binary form must reproduce the above copyright
15 *    notice, this list of conditions and the following disclaimer in
16 *    the documentation and/or other materials provided with the
17 *    distribution.
18 *
19 * 3. The end-user documentation included with the redistribution,
20 *    if any, must include the following acknowledgment:
21 *       "This product includes software developed by the
22 *        Apache Software Foundation (http://www.apache.org/)."
23 *    Alternately, this acknowledgment may appear in the software itself,
24 *    if and wherever such third-party acknowledgments normally appear.
25 *
26 * 4. The names "Xerces" and "Apache Software Foundation" must
27 *    not be used to endorse or promote products derived from this
28 *    software without prior written permission. For written
29 *    permission, please contact apache\@apache.org.
30 *
31 * 5. Products derived from this software may not be called "Apache",
32 *    nor may "Apache" appear in their name, without prior written
33 *    permission of the Apache Software Foundation.
34 *
35 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
36 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
37 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
38 * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
39 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
40 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
41 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
42 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
43 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
44 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
45 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
46 * SUCH DAMAGE.
47 * ====================================================================
48 *
49 * This software consists of voluntary contributions made by many
50 * individuals on behalf of the Apache Software Foundation, and was
51 * originally based on software copyright (c) 1999, International
52 * Business Machines, Inc., http://www.ibm.com .  For more information
53 * on the Apache Software Foundation, please see
54 * <http://www.apache.org/>.
55 */
56
57#if !defined(XERCESVERSION_HPP)
58#define XERCESVERSION_HPP
59
60// ---------------------------------------------------------------------------
61// X E R C E S   V E R S I O N   H E A D E R   D O C U M E N T A T I O N
62
63/**
64 * User Documentation for Xerces Version Values:
65 *
66 *
67 *
68 * Xerces  Notes:
69 *
70 * Xerces Committers Documentation:
71 *
72 *    Xerces committers normally only need to modify one or two of the
73 *    following macros:
74 *
75 *      XERCES_VERSION_MAJOR
76 *      XERCES_VERSION_MINOR
77 *      XERCES_VERSION_REVISION
78 *
79 *    The integer values of these macros define the Xerces version number. All
80 *    other constants and preprocessor macros are automatically generated from
81 *    these three definitions.
82 *
83 *    The macro XERCES_GRAMMAR_SERIALIZATION_LEVEL has been added so that during
84 *    development if users are using the latest code they can use the grammar
85 *    serialization/desialization features.  Whenever a change is made to the
86 *    serialization code this macro should be incremented.
87 *
88 * Xerces User Documentation:
89 *
90 *  The following sections in the user documentation have examples based upon
91 *  the following three version input values:
92 *
93 *    #define XERCES_VERSION_MAJOR 19
94 *    #define XERCES_VERSION_MINOR 3
95 *    #define XERCES_VERSION_REVISION 74
96 *
97 *  The minor and revision (patch level) numbers have two digits of resolution
98 *  which means that '3' becomes '03' in this example. This policy guarantees
99 *  that when using preprocessor macros, version 19.3.74 will be greater than
100 *  version 1.94.74 since the first will expand to 190374 and the second to
101 *  19474.
102 *
103 *  Preprocessor Macros:
104 *
105 *    _XERCES_VERSION defines the primary preprocessor macro that users will
106 *    introduce into their code to perform conditional compilation where the
107 *    version of Xerces is detected in order to enable or disable version
108 *    specific capabilities. The value of _XERCES_VERSION for the above example
109 *    will be 190374. To use it a user would perform an operation such as the
110 *    following:
111 *
112 *      #if _XERCES_VERSION >= 190374
113 *        // code specific to new version of Xerces...
114 *      #else
115 *        // old code here...
116 *      #endif
117 *
118 *    XERCES_FULLVERSIONSTR is a preprocessor macro that expands to a string
119 *    constant whose value, for the above example, will be "19_3_74".
120 *
121 *    XERCES_FULLVERSIONDOT is a preprocessor macro that expands to a string
122 *    constant whose value, for the above example, will be "19.3.74".
123 *
124 *    XERCES_VERSIONSTR is a preprocessor macro that expands to a string
125 *    constant whose value, for the above example, will be "19_3". This
126 *    particular macro is very dangerous if it were to be used for comparing
127 *    version numbers since ordering will not be guaranteed.
128 *
129 *    Xerces_DLLVersionStr is a preprocessor macro that expands to a string
130 *    constant whose value, for the above example, will be "19_3_74". This
131 *    macro is provided for backwards compatibility to pre-1.7 versions of
132 *    Xerces.
133 *
134 *  String Constants:
135 *
136 *    gXercesVersionStr is a global string constant whose value corresponds to
137 *    the value "19_3" for the above example.
138 *
139 *    gXercesFullVersionStr is a global string constant whose value corresponds
140 *    to the value "19_3_74" for the above example.
141 *
142 *  Numeric Constants:
143 *
144 *    gXercesMajVersion is a global integer constant whose value corresponds to
145 *    the major version number. For the above example its value will be 19.
146 *
147 *    gXercesMinVersion is a global integer constant whose value corresponds to
148 *    the minor version number. For the above example its value will be 3.
149 *
150 *    gXercesRevision is a global integer constant whose value corresponds to
151 *    the revision (patch) version number. For the above example its value will
152 *    be 74.
153 *
154 */
155
156// ---------------------------------------------------------------------------
157// X E R C E S   V E R S I O N   S P E C I F I C A T I O N
158
159/**
160 * MODIFY THESE NUMERIC VALUES TO COINCIDE WITH XERCES VERSION
161 * AND DO NOT MODIFY ANYTHING ELSE IN THIS VERSION HEADER FILE
162 */
163
164#define XERCES_VERSION_MAJOR 2
165#define XERCES_VERSION_MINOR 5
166#define XERCES_VERSION_REVISION 0
167
168#define XERCES_GRAMMAR_SERIALIZATION_LEVEL 1
169
170/** DO NOT MODIFY BELOW THIS LINE */
171
172/**
173 * MAGIC THAT AUTOMATICALLY GENERATES THE FOLLOWING:
174 *
175 *      Xerces_DLLVersionStr, gXercesVersionStr, gXercesFullVersionStr,
176 *      gXercesMajVersion, gXercesMinVersion, gXercesRevision
177 */
178
179// ---------------------------------------------------------------------------
180// T W O   A R G U M E N T   C O N C A T E N A T I O N   M A C R O S
181
182// two argument concatenation routines
183#define CAT2_SEP_UNDERSCORE(a, b) #a "_" #b
184#define CAT2_SEP_PERIOD(a, b) #a "." #b
185#define CAT2_SEP_NIL(a, b) #a #b
186#define CAT2_RAW_NUMERIC(a, b) a ## b
187
188// two argument macro invokers
189#define INVK_CAT2_SEP_UNDERSCORE(a,b) CAT2_SEP_UNDERSCORE(a,b)
190#define INVK_CAT2_SEP_PERIOD(a,b)     CAT2_SEP_PERIOD(a,b)
191#define INVK_CAT2_STR_SEP_NIL(a,b)    CAT2_SEP_NIL(a,b)
192#define INVK_CAT2_RAW_NUMERIC(a,b)    CAT2_RAW_NUMERIC(a,b)
193
194// ---------------------------------------------------------------------------
195// T H R E E   A R G U M E N T   C O N C A T E N A T I O N   M A C R O S
196
197// three argument concatenation routines
198#define CAT3_SEP_UNDERSCORE(a, b, c) #a "_" #b "_" #c
199#define CAT3_SEP_PERIOD(a, b, c) #a "." #b "." #c
200#define CAT3_SEP_NIL(a, b, c) #a #b #c
201#define CAT3_RAW_NUMERIC(a, b, c) a ## b ## c
202#define CAT3_RAW_NUMERIC_SEP_UNDERSCORE(a, b, c) a ## _ ## b ## _ ## c
203
204// three argument macro invokers
205#define INVK_CAT3_SEP_UNDERSCORE(a,b,c) CAT3_SEP_UNDERSCORE(a,b,c)
206#define INVK_CAT3_SEP_PERIOD(a,b,c)     CAT3_SEP_PERIOD(a,b,c)
207#define INVK_CAT3_SEP_NIL(a,b,c)        CAT3_SEP_NIL(a,b,c)
208#define INVK_CAT3_RAW_NUMERIC(a,b,c)    CAT3_RAW_NUMERIC(a,b,c)
209#define INVK_CAT3_RAW_NUMERIC_SEP_UNDERSCORE(a,b,c)    CAT3_RAW_NUMERIC_SEP_UNDERSCORE(a,b,c)
210
211// ---------------------------------------------------------------------------
212// C A L C U L A T E   V E R S I O N   -   E X P A N D E D   F O R M
213
214#define MULTIPLY(factor,value) factor * value
215#define CALC_EXPANDED_FORM(a,b,c) ( MULTIPLY(10000,a) + MULTIPLY(100,b) + MULTIPLY(1,c) )
216
217// ---------------------------------------------------------------------------
218// X E R C E S   V E R S I O N   I N F O R M A T I O N
219
220// Xerces version strings; these particular macros cannot be used for
221// conditional compilation as they are not numeric constants
222
223#define XERCES_FULLVERSIONSTR INVK_CAT3_SEP_UNDERSCORE(XERCES_VERSION_MAJOR,XERCES_VERSION_MINOR,XERCES_VERSION_REVISION)
224#define XERCES_FULLVERSIONDOT INVK_CAT3_SEP_PERIOD(XERCES_VERSION_MAJOR,XERCES_VERSION_MINOR,XERCES_VERSION_REVISION)
225#define XERCES_FULLVERSIONNUM INVK_CAT3_SEP_NIL(XERCES_VERSION_MAJOR,XERCES_VERSION_MINOR,XERCES_VERSION_REVISION)
226#define XERCES_VERSIONSTR     INVK_CAT2_SEP_UNDERSCORE(XERCES_VERSION_MAJOR,XERCES_VERSION_MINOR)
227
228// Xerces C++ Namespace string, concatenated with full version string
229#define XERCES_PRODUCT xercesc
230#define XERCES_CPP_NAMESPACE INVK_CAT3_RAW_NUMERIC_SEP_UNDERSCORE(XERCES_PRODUCT,XERCES_VERSION_MAJOR,XERCES_VERSION_MINOR)
231
232// original from Xerces header
233#define Xerces_DLLVersionStr XERCES_FULLVERSIONSTR
234
235const char* const    gXercesVersionStr = XERCES_VERSIONSTR;
236const char* const    gXercesFullVersionStr = XERCES_FULLVERSIONSTR;
237const unsigned int   gXercesMajVersion = XERCES_VERSION_MAJOR;
238const unsigned int   gXercesMinVersion = XERCES_VERSION_MINOR;
239const unsigned int   gXercesRevision   = XERCES_VERSION_REVISION;
240
241// Xerces version numeric constants that can be used for conditional
242// compilation purposes.
243
244#define _XERCES_VERSION CALC_EXPANDED_FORM (XERCES_VERSION_MAJOR,XERCES_VERSION_MINOR,XERCES_VERSION_REVISION)
245
246#endif // XERCESVERSION_HPP
Note: See TracBrowser for help on using the repository browser.