9 " * @brief Define preprocessor symbols for the library version",
11 "// Copyright (C) 2002,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2015,2016,2017,2018,2020 Olly Betts",
13 "// This program is free software; you can redistribute it and/or",
14 "// modify it under the terms of the GNU General Public License as",
15 "// published by the Free Software Foundation; either version 2 of the",
16 "// License, or (at your option) any later version.",
18 "// This program is distributed in the hope that it will be useful,",
19 "// but WITHOUT ANY WARRANTY; without even the implied warranty of",
20 "// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the",
21 "// GNU General Public License for more details.",
23 "// You should have received a copy of the GNU General Public License",
24 "// along with this program; if not, write to the Free Software",
25 "// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA",
27 "#ifndef XAPIAN_INCLUDED_VERSION_H",
28 "#define XAPIAN_INCLUDED_VERSION_H",
58 # define BUILD_COMPILER "clang++ " __clang_version__ 59 #elif defined __INTEL_COMPILER 60 # define BUILD_COMPILER "icc " J(__INTEL_COMPILER) 62 #elif defined __GNUC_PATCHLEVEL__ 63 # define BUILD_COMPILER "g++ " V(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__) 64 # define V(A,B,C) J(A,B,C) 65 # define J(A,B,C) #A"."#B"."#C 67 # define BUILD_COMPILER "g++ " V(__GNUC__, __GNUC_MINOR__) 68 # define V(A,B) J(A,B) 69 # define J(A,B) #A"."#B 72 "#if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ == 0)",
73 "#error Xapian no longer supports GCC < 3.1",
75 #ifndef __GXX_ABI_VERSION 76 #error GCC does not have __GXX_ABI_VERSION defined 80 "#if !defined(__GXX_ABI_VERSION) || __GXX_ABI_VERSION != ", __GXX_ABI_VERSION,
81 #if __GXX_ABI_VERSION >= 1002 85 "#if defined __GXX_ABI_VERSION && __GXX_ABI_VERSION >= 1002",
86 "#warning The C++ ABI version of compiler you are using does not exactly match",
87 "#warning that of the compiler used to build the library. If linking fails",
88 "#warning due to missing symbols, this is probably the reason why.",
89 "#warning The Xapian library was built with ", BUILD_COMPILER
92 "#error The C++ ABI version of compiler you are using does not match",
93 "#error that of the compiler used to build the library. The versions",
94 "#error must match or your program will not work correctly.",
95 "#error The Xapian library was built with ", BUILD_COMPILER
96 #if __GXX_ABI_VERSION >= 1002 103 #if (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || __GNUC__ >= 4 104 #ifdef _GLIBCXX_DEBUG 105 "#ifndef _GLIBCXX_DEBUG",
106 "#error This library was compiled with _GLIBCXX_DEBUG defined, but you",
107 "#error have not specified this flag. The settings must match or your",
108 "#error program will not work correctly.",
111 "#ifdef _GLIBCXX_DEBUG",
112 "#error You are compiling with _GLIBCXX_DEBUG defined, but the library",
113 "#error was not compiled with this flag. The settings must match or your",
114 "#error program will not work correctly.",
121 #elif defined _MSC_VER 128 "#error This library was compiled with _DEBUG defined, but you",
129 "#error have not specified this flag. The settings must match or your",
130 "#error program will not work correctly.",
134 "#error You are compiling with _DEBUG defined, but the library",
135 "#error was not compiled with this flag. The settings must match or your",
136 "#error program will not work correctly.",
142 #ifdef XAPIAN_ENABLE_VISIBILITY 143 "/// The library was compiled with GCC's -fvisibility=hidden option.",
144 "#define XAPIAN_ENABLE_VISIBILITY",
147 "/// The version of Xapian as a C string literal.",
148 "#define XAPIAN_VERSION ", STRING_VERSION,
150 "/** The major component of the Xapian version.",
151 " * E.g. for Xapian 1.0.14 this would be: 1",
153 "#define XAPIAN_MAJOR_VERSION ", MAJOR_VERSION,
155 "/** The minor component of the Xapian version.",
156 " * E.g. for Xapian 1.0.14 this would be: 0",
158 "#define XAPIAN_MINOR_VERSION ", MINOR_VERSION,
160 "/** The revision component of the Xapian version.",
161 " * E.g. for Xapian 1.0.14 this would be: 14",
163 "#define XAPIAN_REVISION ",
REVISION,
165 "/// Base (signed) type for Xapian::docid and related types.",
168 "/// Base (signed) type for Xapian::termcount and related types.",
171 "/// Base (signed) type for Xapian::termpos.",
174 "/// Type for returning total document length.",
177 "/// Underlying type for Xapian::rev.",
180 "/// XAPIAN_HAS_CHERT_BACKEND Defined if the chert backend is enabled.",
181 #ifdef XAPIAN_HAS_CHERT_BACKEND 182 "#define XAPIAN_HAS_CHERT_BACKEND 1",
184 "/* #undef XAPIAN_HAS_CHERT_BACKEND */",
187 "/// XAPIAN_HAS_GLASS_BACKEND Defined if the glass backend is enabled.",
188 #ifdef XAPIAN_HAS_GLASS_BACKEND 189 "#define XAPIAN_HAS_GLASS_BACKEND 1",
191 "/* #undef XAPIAN_HAS_GLASS_BACKEND */",
194 "/// XAPIAN_HAS_INMEMORY_BACKEND Defined if the inmemory backend is enabled.",
195 #ifdef XAPIAN_HAS_INMEMORY_BACKEND 196 "#define XAPIAN_HAS_INMEMORY_BACKEND 1",
198 "/* #undef XAPIAN_HAS_INMEMORY_BACKEND */",
201 "/// XAPIAN_HAS_REMOTE_BACKEND Defined if the remote backend is enabled.",
202 #ifdef XAPIAN_HAS_REMOTE_BACKEND 203 "#define XAPIAN_HAS_REMOTE_BACKEND 1",
205 "/* #undef XAPIAN_HAS_REMOTE_BACKEND */",
208 "/// XAPIAN_AT_LEAST(A,B,C) checks for xapian-core >= A.B.C - use like so:",
211 "/// #if XAPIAN_AT_LEAST(1,4,2)",
212 "/// /* Code needing features needing Xapian >= 1.4.2. */",
216 "/// Added in Xapian 1.4.2.",
217 "#define XAPIAN_AT_LEAST(A,B,C) \\",
218 " (XAPIAN_MAJOR_VERSION > (A) || \\",
219 " (XAPIAN_MAJOR_VERSION == (A) && \\",
220 " (XAPIAN_MINOR_VERSION > (B) || \\",
221 " (XAPIAN_MINOR_VERSION == (B) && XAPIAN_REVISION >= (C)))))",
223 "/// We support move semantics when we're confident the compiler supports it.",
225 "/// C++11 move semantics are very useful in threaded code that wants to",
226 "/// hand-off Xapian objects to worker threads, but in this case it's very",
227 "/// unhelpful for availability of these semantics to vary by compiler as it",
228 "/// quietly leads to a build with non-threadsafe behaviour.",
230 "/// User code can #define XAPIAN_MOVE_SEMANTICS to force this on, and will",
231 "/// then get a compilation failure if the compiler lacks suitable support.",
232 "#ifndef XAPIAN_MOVE_SEMANTICS",
233 "# if __cplusplus >= 201103L || \\",
234 " (defined _MSC_VER && _MSC_VER >= 1900) || \\",
235 " defined XAPIAN_LIB_BUILD",
236 "# define XAPIAN_MOVE_SEMANTICS",
240 "#endif /* XAPIAN_INCLUDED_VERSION_H */" #define XAPIAN_TERMPOS_BASE_TYPE
Base (signed) type for Xapian::termpos.
#define XAPIAN_REVISION_TYPE
Underlying type for Xapian::rev.
#define XAPIAN_DOCID_BASE_TYPE
Base (signed) type for Xapian::docid and related types.
unsigned REVISION(const uint8_t *b)
#define XAPIAN_TERMCOUNT_BASE_TYPE
Base (signed) type for Xapian::termcount and related types.