Author: wyoung
Date: Fri Jan 12 12:30:14 2007
New Revision: 1384

URL: http://svn.gna.org/viewcvs/mysqlpp?rev=1384&view=rev
Log:
- Renamed MYSQLPP_LIB_VERSION to MYSQLPP_HEADER_VERSION, as what it
  really encodes is the version number in the mysql++.h file you're
  using, not the actual library version number.
- Added ::get_library_version(), which returns MYSQLPP_HEADER_VERSION
  as it exists at the time the library is built.  Between this and the
  constant, you can check that you're not mixing MySQL++ header and
  library versions.

Added:
    trunk/lib/mysql++.cpp
Modified:
    trunk/lib/mysql++.h.in
    trunk/mysql++.bkl

Added: trunk/lib/mysql++.cpp
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/mysql%2B%2B.cpp?rev=1384&view=auto
==============================================================================
--- trunk/lib/mysql++.cpp (added)
+++ trunk/lib/mysql++.cpp Fri Jan 12 12:30:14 2007
@@ -1,0 +1,38 @@
+/***********************************************************************
+ mysql++.cpp - Implements functions dealing with the library itself,
+       as opposed to individual features of the library.
+
+ Copyright (c) 2007 by Educational Technology Resources, Inc.
+ Others may also hold copyrights on code in this file.  See the CREDITS
+ file in the top directory of the distribution for details.
+
+ This file is part of MySQL++.
+
+ MySQL++ is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ MySQL++ is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with MySQL++; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+ USA
+***********************************************************************/
+
+#include "mysql++.h"
+
+namespace mysqlpp {
+
+unsigned int 
+get_library_version()
+{
+       return MYSQLPP_HEADER_VERSION;
+}
+
+} // end namespace mysqlpp
+

Modified: trunk/lib/mysql++.h.in
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/mysql%2B%2B.h.in?rev=1384&r1=1383&r2=1384&view=diff
==============================================================================
--- trunk/lib/mysql++.h.in (original)
+++ trunk/lib/mysql++.h.in Fri Jan 12 12:30:14 2007
@@ -38,16 +38,27 @@
 /// \brief Encode MySQL++ library version number.
 ///
 /// This macro takes major, minor and bugfix numbers (e.g. 1, 2, and 3)
-/// and encodes them like 0x010203.  MYSQLPP_LIB_VERSION is the current
-/// library version in the same scheme, so between these two macros you
-/// can create conditional code based on the MySQL++ library version.
+/// and encodes them like 0x010203.
 #define MYSQLPP_VERSION(major, minor, bugfix) \
                (((major) << 16) | ((minor) << 8) | (bugfix))
 
+/// \brief Get the library version number that mysql++.h comes from
+///
+/// MySQL++ Version number that the mysql++.h header file comes from,
+/// encoded by MYSQLPP_VERSION macro.  Compare this value to what
+/// mysqlpp_lib_version() returns in order to ensure that your program
+/// is using header files from the same version of MySQL++ as the
+/// actual library you're linking to.
+#define MYSQLPP_HEADER_VERSION MYSQLPP_VERSION(@MYSQLPP_VERSION_MAJOR@, 
@MYSQLPP_VERSION_MINOR@, @MYSQLPP_VERSION_BUGFIX@)
+
 /// \brief Get the current MySQL++ library version number
 ///
-/// Version number is encoded by MYSQLPP_VERSION macro.
-#define MYSQLPP_LIB_VERSION MYSQLPP_VERSION(@MYSQLPP_VERSION_MAJOR@, 
@MYSQLPP_VERSION_MINOR@, @MYSQLPP_VERSION_BUGFIX@)
+/// MySQL++ version number that the program is actually linked to,
+/// encoded by MYSQLPP_VERSION macro.  Compare this value to the
+/// MYSQLPP_HEADER_VERSION constant in order to ensure that your
+/// program is using header files from the same version of MySQL++ as
+/// the actual library you're linking to.
+unsigned int get_library_version();
 
 // This #include order gives the fewest redundancies in the #include
 // dependency chain.

Modified: trunk/mysql++.bkl
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/mysql%2B%2B.bkl?rev=1384&r1=1383&r2=1384&view=diff
==============================================================================
--- trunk/mysql++.bkl (original)
+++ trunk/mysql++.bkl Fri Jan 12 12:30:14 2007
@@ -41,6 +41,7 @@
                                lib/field_types.cpp
                                lib/manip.cpp
                                lib/myset.cpp
+                               lib/mysql++.cpp
                                lib/qparms.cpp
                                lib/query.cpp
                                lib/result.cpp


_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits

Reply via email to