9 " * @brief Define preprocessor symbols for the library version",
11 "// Copyright (C) 2002-2022 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",
55 "#if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ == 0)",
56 "#error Xapian no longer supports GCC < 3.1",
60 #if (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || __GNUC__ >= 4 62 "#ifndef _GLIBCXX_DEBUG",
63 "#error This library was compiled with _GLIBCXX_DEBUG defined, but you",
64 "#error have not specified this flag. The settings must match or your",
65 "#error program will not work correctly.",
68 "#ifdef _GLIBCXX_DEBUG",
69 "#error You are compiling with _GLIBCXX_DEBUG defined, but the library",
70 "#error was not compiled with this flag. The settings must match or your",
71 "#error program will not work correctly.",
78 #elif defined _MSC_VER 85 "#error This library was compiled with _DEBUG defined, but you",
86 "#error have not specified this flag. The settings must match or your",
87 "#error program will not work correctly.",
91 "#error You are compiling with _DEBUG defined, but the library",
92 "#error was not compiled with this flag. The settings must match or your",
93 "#error program will not work correctly.",
99 #ifdef XAPIAN_ENABLE_VISIBILITY 100 "/// The library was compiled with GCC's -fvisibility=hidden option.",
101 "#define XAPIAN_ENABLE_VISIBILITY",
104 "/// The version of Xapian as a C string literal.",
105 "#define XAPIAN_VERSION ", STRING_VERSION,
107 "/** The major component of the Xapian version.",
108 " * E.g. for Xapian 1.0.14 this would be: 1",
110 "#define XAPIAN_MAJOR_VERSION ", MAJOR_VERSION,
112 "/** The minor component of the Xapian version.",
113 " * E.g. for Xapian 1.0.14 this would be: 0",
115 "#define XAPIAN_MINOR_VERSION ", MINOR_VERSION,
117 "/** The revision component of the Xapian version.",
118 " * E.g. for Xapian 1.0.14 this would be: 14",
120 "#define XAPIAN_REVISION ",
REVISION,
122 "/// Base (signed) type for Xapian::docid and related types.",
125 "/// Base (signed) type for Xapian::termcount and related types.",
128 "/// Base (signed) type for Xapian::termpos.",
131 "/// Type for returning total document length.",
134 "/// Underlying type for Xapian::rev.",
137 "/// XAPIAN_HAS_CHERT_BACKEND Defined if the chert backend is enabled.",
138 #ifdef XAPIAN_HAS_CHERT_BACKEND 139 "#define XAPIAN_HAS_CHERT_BACKEND 1",
141 "/* #undef XAPIAN_HAS_CHERT_BACKEND */",
144 "/// XAPIAN_HAS_GLASS_BACKEND Defined if the glass backend is enabled.",
145 #ifdef XAPIAN_HAS_GLASS_BACKEND 146 "#define XAPIAN_HAS_GLASS_BACKEND 1",
148 "/* #undef XAPIAN_HAS_GLASS_BACKEND */",
151 "/// XAPIAN_HAS_INMEMORY_BACKEND Defined if the inmemory backend is enabled.",
152 #ifdef XAPIAN_HAS_INMEMORY_BACKEND 153 "#define XAPIAN_HAS_INMEMORY_BACKEND 1",
155 "/* #undef XAPIAN_HAS_INMEMORY_BACKEND */",
158 "/// XAPIAN_HAS_REMOTE_BACKEND Defined if the remote backend is enabled.",
159 #ifdef XAPIAN_HAS_REMOTE_BACKEND 160 "#define XAPIAN_HAS_REMOTE_BACKEND 1",
162 "/* #undef XAPIAN_HAS_REMOTE_BACKEND */",
165 "/// XAPIAN_AT_LEAST(A,B,C) checks for xapian-core >= A.B.C - use like so:",
168 "/// #if XAPIAN_AT_LEAST(1,4,2)",
169 "/// /* Code needing features needing Xapian >= 1.4.2. */",
173 "/// Added in Xapian 1.4.2.",
174 "#define XAPIAN_AT_LEAST(A,B,C) \\",
175 " (XAPIAN_MAJOR_VERSION > (A) || \\",
176 " (XAPIAN_MAJOR_VERSION == (A) && \\",
177 " (XAPIAN_MINOR_VERSION > (B) || \\",
178 " (XAPIAN_MINOR_VERSION == (B) && XAPIAN_REVISION >= (C)))))",
180 "/// We support move semantics when we're confident the compiler supports it.",
182 "/// C++11 move semantics are very useful in threaded code that wants to",
183 "/// hand-off Xapian objects to worker threads, but in this case it's very",
184 "/// unhelpful for availability of these semantics to vary by compiler as it",
185 "/// quietly leads to a build with non-threadsafe behaviour.",
187 "/// User code can #define XAPIAN_MOVE_SEMANTICS to force this on, and will",
188 "/// then get a compilation failure if the compiler lacks suitable support.",
189 "#ifndef XAPIAN_MOVE_SEMANTICS",
190 "# if __cplusplus >= 201103L || \\",
191 " (defined _MSC_VER && _MSC_VER >= 1900) || \\",
192 " defined XAPIAN_LIB_BUILD",
193 "# define XAPIAN_MOVE_SEMANTICS",
197 "#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.