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