source: icXML/icXML-devel/src/xercesc/util/XercesVersion.hpp @ 2732

Last change on this file since 2732 was 2722, checked in by cameron, 7 years ago

Original Xerces files with import mods for icxercesc

File size: 8.9 KB
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: XercesVersion.hpp 935350 2010-04-18 15:02:36Z borisk $
20 */
21
22#if !defined(XERCESC_INCLUDE_GUARD_XERCESVERSION_HPP)
23#define XERCESC_INCLUDE_GUARD_XERCESVERSION_HPP
24
25// ---------------------------------------------------------------------------
26// 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
27
28/**
29 * User Documentation for Xerces Version Values:
30 *
31 *
32 *
33 * Xerces  Notes:
34 *
35 * Xerces Committers Documentation:
36 *
37 *    Xerces committers normally only need to modify one or two of the
38 *    following macros:
39 *
40 *      XERCES_VERSION_MAJOR
41 *      XERCES_VERSION_MINOR
42 *      XERCES_VERSION_REVISION
43 *
44 *    The integer values of these macros define the Xerces version number. All
45 *    other constants and preprocessor macros are automatically generated from
46 *    these three definitions.
47 *
48 *    The macro XERCES_GRAMMAR_SERIALIZATION_LEVEL has been added so that during
49 *    development if users are using the latest code they can use the grammar
50 *    serialization/deserialization features.  Whenever a change is made to the
51 *    serialization code this macro should be incremented.
52 *
53 * Xerces User Documentation:
54 *
55 *  The following sections in the user documentation have examples based upon
56 *  the following three version input values:
57 *
58 *    #define XERCES_VERSION_MAJOR 19
59 *    #define XERCES_VERSION_MINOR 3
60 *    #define XERCES_VERSION_REVISION 74
61 *
62 *  The minor and revision (patch level) numbers have two digits of resolution
63 *  which means that '3' becomes '03' in this example. This policy guarantees
64 *  that when using preprocessor macros, version 19.3.74 will be greater than
65 *  version 1.94.74 since the first will expand to 190374 and the second to
66 *  19474.
67 *
68 *  Preprocessor Macros:
69 *
70 *    _XERCES_VERSION defines the primary preprocessor macro that users will
71 *    introduce into their code to perform conditional compilation where the
72 *    version of Xerces is detected in order to enable or disable version
73 *    specific capabilities. The value of _XERCES_VERSION for the above example
74 *    will be 190374. To use it a user would perform an operation such as the
75 *    following:
76 *
77 *      #if _XERCES_VERSION >= 190374
78 *        // code specific to new version of Xerces...
79 *      #else
80 *        // old code here...
81 *      #endif
82 *
83 *    XERCES_FULLVERSIONSTR is a preprocessor macro that expands to a string
84 *    constant whose value, for the above example, will be "19_3_74".
85 *
86 *    XERCES_FULLVERSIONDOT is a preprocessor macro that expands to a string
87 *    constant whose value, for the above example, will be "19.3.74".
88 *
89 *    XERCES_VERSIONSTR is a preprocessor macro that expands to a string
90 *    constant whose value, for the above example, will be "19_3". This
91 *    particular macro is very dangerous if it were to be used for comparing
92 *    version numbers since ordering will not be guaranteed.
93 *
94 *    Xerces_DLLVersionStr is a preprocessor macro that expands to a string
95 *    constant whose value, for the above example, will be "19_3_74". This
96 *    macro is provided for backwards compatibility to pre-1.7 versions of
97 *    Xerces.
98 *
99 *  String Constants:
100 *
101 *    gXercesVersionStr is a global string constant whose value corresponds to
102 *    the value "19_3" for the above example.
103 *
104 *    gXercesFullVersionStr is a global string constant whose value corresponds
105 *    to the value "19_3_74" for the above example.
106 *
107 *  Numeric Constants:
108 *
109 *    gXercesMajVersion is a global integer constant whose value corresponds to
110 *    the major version number. For the above example its value will be 19.
111 *
112 *    gXercesMinVersion is a global integer constant whose value corresponds to
113 *    the minor version number. For the above example its value will be 3.
114 *
115 *    gXercesRevision is a global integer constant whose value corresponds to
116 *    the revision (patch) version number. For the above example its value will
117 *    be 74.
118 *
119 */
120
121// ---------------------------------------------------------------------------
122// 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
123
124/**
125 * MODIFY THESE NUMERIC VALUES TO COINCIDE WITH XERCES VERSION
126 * AND DO NOT MODIFY ANYTHING ELSE IN THIS VERSION HEADER FILE
127 */
128
129#define XERCES_VERSION_MAJOR 3
130#define XERCES_VERSION_MINOR 1
131#define XERCES_VERSION_REVISION 1
132
133/***
134 *
135 * XERCES_GRAMMAR_SERIALIZATION_LEVEL = 4   SchemaAttDef, SchemaElementDecl serialize fPSVIScope
136 * XERCES_GRAMMAR_SERIALIZATION_LEVEL = 5   XercesStep serializes the axis as an int
137 * XERCES_GRAMMAR_SERIALIZATION_LEVEL = 6   added fIsExternal to XMLEntityDecl
138 * XERCES_GRAMMAR_SERIALIZATION_LEVEL = 7   size of line/column fields has changed
139 *
140 ***/
141#define XERCES_GRAMMAR_SERIALIZATION_LEVEL 7
142
143/** DO NOT MODIFY BELOW THIS LINE */
144
145/**
146 * MAGIC THAT AUTOMATICALLY GENERATES THE FOLLOWING:
147 *
148 *      Xerces_DLLVersionStr, gXercesVersionStr, gXercesFullVersionStr,
149 *      gXercesMajVersion, gXercesMinVersion, gXercesRevision
150 */
151
152// ---------------------------------------------------------------------------
153// 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
154
155// two argument concatenation routines
156#define CAT2_SEP_UNDERSCORE(a, b) #a "_" #b
157#define CAT2_SEP_PERIOD(a, b) #a "." #b
158#define CAT2_SEP_NIL(a, b) #a #b
159#define CAT2_RAW_NUMERIC(a, b) a ## b
160
161// two argument macro invokers
162#define INVK_CAT2_SEP_UNDERSCORE(a,b) CAT2_SEP_UNDERSCORE(a,b)
163#define INVK_CAT2_SEP_PERIOD(a,b)     CAT2_SEP_PERIOD(a,b)
164#define INVK_CAT2_STR_SEP_NIL(a,b)    CAT2_SEP_NIL(a,b)
165#define INVK_CAT2_RAW_NUMERIC(a,b)    CAT2_RAW_NUMERIC(a,b)
166
167// ---------------------------------------------------------------------------
168// 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
169
170// three argument concatenation routines
171#define CAT3_SEP_UNDERSCORE(a, b, c) #a "_" #b "_" #c
172#define CAT3_SEP_PERIOD(a, b, c) #a "." #b "." #c
173#define CAT3_SEP_NIL(a, b, c) #a #b #c
174#define CAT3_RAW_NUMERIC(a, b, c) a ## b ## c
175#define CAT3_RAW_NUMERIC_SEP_UNDERSCORE(a, b, c) a ## _ ## b ## _ ## c
176
177// three argument macro invokers
178#define INVK_CAT3_SEP_UNDERSCORE(a,b,c) CAT3_SEP_UNDERSCORE(a,b,c)
179#define INVK_CAT3_SEP_PERIOD(a,b,c)     CAT3_SEP_PERIOD(a,b,c)
180#define INVK_CAT3_SEP_NIL(a,b,c)        CAT3_SEP_NIL(a,b,c)
181#define INVK_CAT3_RAW_NUMERIC(a,b,c)    CAT3_RAW_NUMERIC(a,b,c)
182#define INVK_CAT3_RAW_NUMERIC_SEP_UNDERSCORE(a,b,c)    CAT3_RAW_NUMERIC_SEP_UNDERSCORE(a,b,c)
183
184// ---------------------------------------------------------------------------
185// 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
186
187#define MULTIPLY(factor,value) factor * value
188#define CALC_EXPANDED_FORM(a,b,c) ( MULTIPLY(10000,a) + MULTIPLY(100,b) + MULTIPLY(1,c) )
189
190// ---------------------------------------------------------------------------
191// X E R C E S   V E R S I O N   I N F O R M A T I O N
192
193// Xerces version strings; these particular macros cannot be used for
194// conditional compilation as they are not numeric constants
195
196#define XERCES_FULLVERSIONSTR INVK_CAT3_SEP_UNDERSCORE(XERCES_VERSION_MAJOR,XERCES_VERSION_MINOR,XERCES_VERSION_REVISION)
197#define XERCES_FULLVERSIONDOT INVK_CAT3_SEP_PERIOD(XERCES_VERSION_MAJOR,XERCES_VERSION_MINOR,XERCES_VERSION_REVISION)
198#define XERCES_FULLVERSIONNUM INVK_CAT3_SEP_NIL(XERCES_VERSION_MAJOR,XERCES_VERSION_MINOR,XERCES_VERSION_REVISION)
199#define XERCES_VERSIONSTR     INVK_CAT2_SEP_UNDERSCORE(XERCES_VERSION_MAJOR,XERCES_VERSION_MINOR)
200
201// Xerces C++ Namespace string, concatenated with full version string
202#define XERCES_PRODUCT xercesc
203#define XERCES_CPP_NAMESPACE INVK_CAT3_RAW_NUMERIC_SEP_UNDERSCORE(XERCES_PRODUCT,XERCES_VERSION_MAJOR,XERCES_VERSION_MINOR)
204
205// original from Xerces header
206#define Xerces_DLLVersionStr XERCES_FULLVERSIONSTR
207
208const char* const    gXercesVersionStr = XERCES_VERSIONSTR;
209const char* const    gXercesFullVersionStr = XERCES_FULLVERSIONSTR;
210const unsigned int   gXercesMajVersion = XERCES_VERSION_MAJOR;
211const unsigned int   gXercesMinVersion = XERCES_VERSION_MINOR;
212const unsigned int   gXercesRevision   = XERCES_VERSION_REVISION;
213
214// Xerces version numeric constants that can be used for conditional
215// compilation purposes.
216
217#define _XERCES_VERSION CALC_EXPANDED_FORM (XERCES_VERSION_MAJOR,XERCES_VERSION_MINOR,XERCES_VERSION_REVISION)
218
219#endif // XERCESVERSION_HPP
Note: See TracBrowser for help on using the repository browser.