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, see",
25 "// <https://www.gnu.org/licenses/>.",
27 "#ifndef XAPIAN_INCLUDED_VERSION_H",
28 "#define XAPIAN_INCLUDED_VERSION_H",
30 "#if !defined XAPIAN_IN_XAPIAN_H && !defined XAPIAN_LIB_BUILD",
31 "# error @@Never use <xapian/version.h> directly; include <xapian.h> instead.@@",
54 "#if !defined __clang__ && !defined __INTEL_COMPILER && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 8))",
55 "#error Xapian no longer supports GCC < 4.8",
59 "#ifndef _GLIBCXX_DEBUG",
60 "#error This library was compiled with _GLIBCXX_DEBUG defined, but you",
61 "#error have not specified this flag. The settings must match or your",
62 "#error program will not work correctly.",
65 "#ifdef _GLIBCXX_DEBUG",
66 "#error You are compiling with _GLIBCXX_DEBUG defined, but the library",
67 "#error was not compiled with this flag. The settings must match or your",
68 "#error program will not work correctly.",
74 #elif defined _MSC_VER
81 "#error This library was compiled with _DEBUG defined, but you",
82 "#error have not specified this flag. The settings must match or your",
83 "#error program will not work correctly.",
87 "#error You are compiling with _DEBUG defined, but the library",
88 "#error was not compiled with this flag. The settings must match or your",
89 "#error program will not work correctly.",
95 #ifdef XAPIAN_ENABLE_VISIBILITY
96 "/// The library was compiled with GCC's -fvisibility=hidden option.",
97 "#define XAPIAN_ENABLE_VISIBILITY",
100 "/// The version of Xapian as a C string literal.",
101 "#define XAPIAN_VERSION ", STRING_VERSION,
103 "/** The major component of the Xapian version.",
104 " * E.g. for Xapian 1.0.14 this would be: 1",
106 "#define XAPIAN_MAJOR_VERSION ", MAJOR_VERSION,
108 "/** The minor component of the Xapian version.",
109 " * E.g. for Xapian 1.0.14 this would be: 0",
111 "#define XAPIAN_MINOR_VERSION ", MINOR_VERSION,
113 "/** The revision component of the Xapian version.",
114 " * E.g. for Xapian 1.0.14 this would be: 14",
116 "#define XAPIAN_REVISION ",
REVISION,
118 "/// Base (signed) type for Xapian::docid and related types.",
121 "/// Base (signed) type for Xapian::termcount and related types.",
124 "/// Base (signed) type for Xapian::termpos.",
127 "/// Type for returning total document length.",
130 "/// Underlying type for Xapian::rev.",
133 "/// XAPIAN_HAS_GLASS_BACKEND Defined if the glass backend is enabled.",
134 #ifdef XAPIAN_HAS_GLASS_BACKEND
135 "#define XAPIAN_HAS_GLASS_BACKEND 1",
137 "/* #undef XAPIAN_HAS_GLASS_BACKEND */",
140 "/// XAPIAN_HAS_HONEY_BACKEND Defined if the honey backend is enabled.",
141 #ifdef XAPIAN_HAS_HONEY_BACKEND
142 "#define XAPIAN_HAS_HONEY_BACKEND 1",
144 "/* #undef XAPIAN_HAS_HONEY_BACKEND */",
147 "/// XAPIAN_HAS_INMEMORY_BACKEND Defined if the inmemory backend is enabled.",
148 #ifdef XAPIAN_HAS_INMEMORY_BACKEND
149 "#define XAPIAN_HAS_INMEMORY_BACKEND 1",
151 "/* #undef XAPIAN_HAS_INMEMORY_BACKEND */",
154 "/// XAPIAN_HAS_REMOTE_BACKEND Defined if the remote backend is enabled.",
155 #ifdef XAPIAN_HAS_REMOTE_BACKEND
156 "#define XAPIAN_HAS_REMOTE_BACKEND 1",
158 "/* #undef XAPIAN_HAS_REMOTE_BACKEND */",
161 "/// XAPIAN_AT_LEAST(A,B,C) checks for xapian-core >= A.B.C - use like so:",
164 "/// #if XAPIAN_AT_LEAST(1,4,2)",
165 "/// /* Code needing features needing Xapian >= 1.4.2. */",
169 "/// XAPIAN_AT_LEAST was added in Xapian 1.4.2. This was released 2016-12-26",
170 "/// so is now a reasonable hard requirement.",
172 "/// If you really want to support older versions beware that a check like:",
174 "/// #if defined XAPIAN_AT_LEAST && XAPIAN_AT_LEAST(1,4,12)",
176 "/// works with newer Xapian but fails to compile if the macro is not",
179 "/// error: missing binary operator before token ‘(’",
181 "/// In this situation we recommend copying the definition of XAPIAN_AT_LEAST",
182 "/// into your code and wrapping it in `#ifndef XAPIAN_AT_LEAST` ... `#endif`",
183 "/// so you can use it unconditionally.",
185 "/// @since Xapian 1.4.2.",
186 "#define XAPIAN_AT_LEAST(A,B,C) \\",
187 " (XAPIAN_MAJOR_VERSION > (A) || \\",
188 " (XAPIAN_MAJOR_VERSION == (A) && \\",
189 " (XAPIAN_MINOR_VERSION > (B) || \\",
190 " (XAPIAN_MINOR_VERSION == (B) && XAPIAN_REVISION >= (C)))))",
192 "#endif /* XAPIAN_INCLUDED_VERSION_H */"
uint4 REVISION(const uint8_t *b)
#define XAPIAN_DOCID_BASE_TYPE
Base (signed) type for Xapian::docid and related types.
#define XAPIAN_TERMCOUNT_BASE_TYPE
Base (signed) type for Xapian::termcount and related types.
#define XAPIAN_REVISION_TYPE
Underlying type for Xapian::rev.
#define XAPIAN_TERMPOS_BASE_TYPE
Base (signed) type for Xapian::termpos.