include/xapian/version_h.cc

Go to the documentation of this file.
00001 // version_h.cc - template used by configure to generate xapian/version.h
00002 // (for portability, files run through $CXXCPP must have extension .c .cc or .C)
00003 #include <config.h>
00004 const char * dummy = {
00005 "// version.h: Define preprocesor symbols for the library version.",
00006 "// If using GCC, also check the C++ ABI version is compatible with that used",
00007 "// to build the library.",
00008 "//",
00009 "// Copyright (C) 2002,2004,2005,2006,2007 Olly Betts",
00010 "//",
00011 "// This program is free software; you can redistribute it and/or",
00012 "// modify it under the terms of the GNU General Public License as",
00013 "// published by the Free Software Foundation; either version 2 of the",
00014 "// License, or (at your option) any later version.",
00015 "//",
00016 "// This program is distributed in the hope that it will be useful,",
00017 "// but WITHOUT ANY WARRANTY; without even the implied warranty of",
00018 "// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the",
00019 "// GNU General Public License for more details.",
00020 "//",
00021 "// You should have received a copy of the GNU General Public License",
00022 "// along with this program; if not, write to the Free Software",
00023 "// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA",
00024 "",
00025 "#ifndef XAPIAN_INCLUDED_VERSION_H",
00026 "#define XAPIAN_INCLUDED_VERSION_H",
00027 #ifdef __GNUC__
00028 // When building the library with GCC, generate preprocessor code to check that
00029 // any version of GCC used to build applications has a matching C++ ABI. This
00030 // means that users get a nice explanatory error message rather than a
00031 // confusing link failure (or worse a program which builds but crashes).
00032 // Another benefit is that the check happens near the start of compilation of
00033 // the first source file which uses Xapian in the user's application, rather
00034 // than during the first attempt to link with Xapian.
00035 //
00036 // We also check that the setting of _GLIBCXX_DEBUG matches since that
00037 // introduces ABI-like incompatibilities.
00038 //
00039 // After preprocessing with "g++ -E" or similar (which will expand macros,
00040 // strip comments such as this block, etc) we remove lines starting with a
00041 // '#', remove blank lines, and collapse multiple spaces.  And we strip out
00042 // double quotes, then replace '@@' with '"', and drop ',' at the end of a
00043 // line (the purpose of the ',' is to prevent certain preprocessors from
00044 // concatenating literal strings).
00045 //
00046 // So for lines we want in the output, we quote parts of the line which we
00047 // don't want substituting, and use @@ where we really want " in the output.
00048 #define V2(A,B) J2(A,B)
00049 #define J2(A,B) g++ A##.##B
00050 #define V3(A,B,C) J3(A,B,C)
00051 #define J3(A,B,C) g++ A##.##B##.##C
00052 "",
00053 "#ifdef __GNUC__",
00054 #ifdef __GXX_ABI_VERSION
00055 // GCC 3.1 reports ABI version 100 (same as 3.0), but this should actually have
00056 // been 101!  So use hard-coded version number checks for 3.0 and 3.1.
00057 #if __GNUC__ == 3 && __GNUC_MINOR__ == 0
00058 "#if !(__GNUC__ == 3 && __GNUC_MINOR__ == 0)",
00059 #elif __GNUC__ == 3 && __GNUC_MINOR__ == 1
00060 "#if !(__GNUC__ == 3 && __GNUC_MINOR__ == 1)",
00061 #else
00062 "#if !defined(__GXX_ABI_VERSION) || __GXX_ABI_VERSION != ",__GXX_ABI_VERSION,
00063 #endif
00064 #elif __GNUC__ == 2 && __GNUC_MINOR__ == 96
00065 "#if !(__GNUC__ == 2 && __GNUC_MINOR__ == 96)",
00066 #else
00067 "#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)",
00068 #endif
00069 "#error The C++ ABI version of compiler you are using does not match",
00070 "#error that of the compiler used to build the library.  The versions",
00071 "#error must match or your program will not work correctly.",
00072 #ifdef __GNUC_PATCHLEVEL__
00073 "#error The Xapian library was built with ",V3(__GNUC__,__GNUC_MINOR__,__GNUC_PATCHLEVEL__),
00074 #else
00075 "#error The Xapian library was built with ",V2(__GNUC__,__GNUC_MINOR__),
00076 #endif
00077 "#endif",
00078 "",
00079 // _GLIBCXX_DEBUG is supported by GCC 3.4 and later so we only need to check
00080 // it for those versions.
00081 #if (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || __GNUC__ >= 4
00082 #ifdef _GLIBCXX_DEBUG
00083 "#ifndef _GLIBCXX_DEBUG",
00084 "#error This library was compiled with _GLIBCXX_DEBUG defined, but you",
00085 "#error have not specified this flag.  The settings must match or your",
00086 "#error program will not work correctly.",
00087 "#endif",
00088 #else
00089 "#ifdef _GLIBCXX_DEBUG",
00090 "#error You are compiling with _GLIBCXX_DEBUG defined, but the library",
00091 "#error was not compiled with this flag.  The settings must match or your",
00092 "#error program will not work correctly.",
00093 "#endif",
00094 #endif
00095 #endif
00096 "#endif",
00097 #endif
00098 "",
00099 "#define XAPIAN_VERSION ",STRING_VERSION,
00100 "#define XAPIAN_MAJOR_VERSION ",MAJOR_VERSION,
00101 "#define XAPIAN_MINOR_VERSION ",MINOR_VERSION,
00102 "#define XAPIAN_REVISION ",REVISION,
00103 "",
00104 #ifdef XAPIAN_HAS_FLINT_BACKEND
00105 "#define XAPIAN_HAS_FLINT_BACKEND 1",
00106 #else
00107 "/* #undef XAPIAN_HAS_FLINT_BACKEND */",
00108 #endif
00109 #ifdef XAPIAN_HAS_QUARTZ_BACKEND
00110 "#define XAPIAN_HAS_QUARTZ_BACKEND 1",
00111 #else
00112 "/* #undef XAPIAN_HAS_QUARTZ_BACKEND */",
00113 #endif
00114 #ifdef XAPIAN_HAS_INMEMORY_BACKEND
00115 "#define XAPIAN_HAS_INMEMORY_BACKEND 1",
00116 #else
00117 "/* #undef XAPIAN_HAS_INMEMORY_BACKEND */",
00118 #endif
00119 #ifdef XAPIAN_HAS_REMOTE_BACKEND
00120 "#define XAPIAN_HAS_REMOTE_BACKEND 1",
00121 #else
00122 "/* #undef XAPIAN_HAS_REMOTE_BACKEND */",
00123 #endif
00124 "",
00125 "#endif /* XAPIAN_INCLUDED_VERSION_H */"
00126 };

Documentation for Xapian (version 1.0.10).
Generated on 24 Dec 2008 by Doxygen 1.5.2.