Author: wyoung
Date: Fri Jan 12 13:41:13 2007
New Revision: 1389

URL: http://svn.gna.org/viewcvs/mysqlpp?rev=1389&view=rev
Log:
Merged lib/defs.h and lib/platform.h into new file, lib/common.h.  There
was no good reason for having separate files here, especially since one
of the two #included the other, so it was often not clear why the code
was using one instead of the other.

Added:
    trunk/lib/common.h
      - copied, changed from r1355, trunk/lib/platform.h
Removed:
    trunk/lib/defs.h
    trunk/lib/platform.h
Modified:
    trunk/Wishlist
    trunk/lib/coldata.h
    trunk/lib/connection.cpp
    trunk/lib/connection.h
    trunk/lib/const_string.h
    trunk/lib/convert.h
    trunk/lib/custom.pl
    trunk/lib/datetime.cpp
    trunk/lib/datetime.h
    trunk/lib/field_names.cpp
    trunk/lib/field_types.cpp
    trunk/lib/manip.h
    trunk/lib/myset.h
    trunk/lib/mysql++.cpp
    trunk/lib/query.h
    trunk/lib/resiter.h
    trunk/lib/result.h
    trunk/lib/sql_string.h
    trunk/lib/sql_types.h
    trunk/lib/string_util.h
    trunk/lib/transaction.cpp
    trunk/lib/transaction.h
    trunk/lib/type_info.cpp
    trunk/lib/type_info.h

Modified: trunk/Wishlist
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/Wishlist?rev=1389&r1=1388&r2=1389&view=diff
==============================================================================
--- trunk/Wishlist (original)
+++ trunk/Wishlist Fri Jan 12 13:41:13 2007
@@ -14,9 +14,6 @@
 ---------
        This plan is fairly solid.  All that remains here are cleanup
        items that we need to tackle before making this release.
-
-       o We probably don't need both platform.h and defs.h.  Fold them
-         together and rework the rest of the library to cope.
 
        o Test that it still works under MinGW after the recent
          DLL linkage fixes for VC++.

Modified: trunk/lib/coldata.h
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/coldata.h?rev=1389&r1=1388&r2=1389&view=diff
==============================================================================
--- trunk/lib/coldata.h (original)
+++ trunk/lib/coldata.h Fri Jan 12 13:41:13 2007
@@ -32,11 +32,10 @@
 #ifndef MYSQLPP_COLDATA_H
 #define MYSQLPP_COLDATA_H
 
-#include "platform.h"
+#include "common.h"
 
 #include "const_string.h"
 #include "convert.h"
-#include "defs.h"
 #include "exceptions.h"
 #include "null.h"
 #include "string_util.h"

Copied: trunk/lib/common.h (from r1355, trunk/lib/platform.h)
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/common.h?p2=trunk/lib/common.h&p1=trunk/lib/platform.h&r1=1355&r2=1389&rev=1389&view=diff
==============================================================================
--- trunk/lib/platform.h (original)
+++ trunk/lib/common.h Fri Jan 12 13:41:13 2007
@@ -1,16 +1,12 @@
-/// \file platform.h
-/// \brief This file includes things that help the rest of MySQL++
-//     remain unaware of platform differences.
+/// \file common.h
+/// \brief This file includes top-level definitions for use both
+/// internal to the library, and outside it.  Contrast mysql++.h
 ///
-/// This file includes all of the platform-specific definitions that
-/// allow the rest of the code to be aware only of platform features,
-/// rather than aware of specific platforms.  On Unixy systems, it
-/// #includes the autoconf-generated header config.h, and on all other
-/// platforms it includes the tests for platform features directly.
+/// This file mostly takes care of platform differences.
 
 /***********************************************************************
  Copyright (c) 1998 by Kevin Atkinson, (c) 1999, 2000 and 2001 by
- MySQL AB, and (c) 2004-2006 by Educational Technology Resources, Inc.
+ MySQL AB, and (c) 2004-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.
 
@@ -32,11 +28,15 @@
  USA
 ***********************************************************************/
 
+#if !defined(MYSQLPP_COMMON_H)
+#define MYSQLPP_COMMON_H
+
 #if !defined(DOXYGEN_IGNORE)
 // Doxygen will not generate documentation for the following stuff.
 
 #include <mysql_version.h>
 
+// Work out major platform-specific stuff here.
 #if defined(__WIN32__) || defined(_WIN32)
 #      define MYSQLPP_PLATFORM_WINDOWS
 
@@ -89,4 +89,67 @@
        #define MYSQLPP_EXPORT
 #endif
 
+namespace mysqlpp {
+
+/// \brief Alias for 'true', to make code requesting exceptions more
+/// readable.
+extern const bool use_exceptions;
+
+/// \brief Used to disambiguate overloads of equal_list() in SSQLSes.
+enum sql_cmp_type { sql_use_compare };
+
+#if !defined(DOXYGEN_IGNORE)
+// Figure out how to get large integer support on this system.  Suppress
+// refman documentation for these typedefs, as they're system-dependent.
+#if defined(NO_LONG_LONGS)
+// Alias "longlong" and "ulonglong" to the regular "long" counterparts
+typedef unsigned long ulonglong;
+typedef long longlong;
+#elif defined(_MSC_VER)
+// It's VC++, so we'll use Microsoft's 64-bit integer types
+typedef unsigned __int64 ulonglong;
+typedef __int64 longlong;
+#else
+// No better idea, so assume the C99 convention.  If your compiler
+// doesn't support this, please provide a patch to extend this ifdef, or
+// define NO_LONG_LONGS.
+typedef unsigned long long ulonglong;
+typedef long long longlong;
+#endif
 #endif // !defined(DOXYGEN_IGNORE)
+
+/// \brief Contraction for 'const char*'
+typedef const char cchar;
+
+#if !defined(MYSQLPP_NO_UNSIGNED_INT_TYPES)
+/// \brief Contraction for 'unsigned int'
+typedef unsigned int uint;
+/// \brief Contraction for 'unsigned long'
+typedef unsigned long ulong;
+#endif
+
+} // end namespace mysqlpp
+
+// The MySQL headers define these macros, which is completely wrong in a
+// C++ project.  Undo the damage.
+#undef min
+#undef max
+
+#endif // !defined(DOXYGEN_IGNORE)
+
+
+// Now that we've defined all the stuff above, we can pull in the full
+// MySQL header.  Basically, the above largely replaces MySQL's my_global.h
+// while actually working with C++.  This is why we disobey the MySQL
+// developer docs, which recommend using my_global.h.
+#include <mysql.h>
+
+
+namespace mysqlpp {
+
+/// \brief Alias for MYSQL_FIELD
+typedef MYSQL_FIELD Field;
+
+} // end namespace mysqlpp
+
+#endif // !defined(MYSQLPP_COMMON_H)

Modified: trunk/lib/connection.cpp
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/connection.cpp?rev=1389&r1=1388&r2=1389&view=diff
==============================================================================
--- trunk/lib/connection.cpp (original)
+++ trunk/lib/connection.cpp Fri Jan 12 13:41:13 2007
@@ -25,7 +25,7 @@
 ***********************************************************************/
 
 #define MYSQLPP_NOT_HEADER
-#include "platform.h"
+#include "common.h"
 
 #include "connection.h"
 

Modified: trunk/lib/connection.h
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/connection.h?rev=1389&r1=1388&r2=1389&view=diff
==============================================================================
--- trunk/lib/connection.h (original)
+++ trunk/lib/connection.h Fri Jan 12 13:41:13 2007
@@ -35,9 +35,7 @@
 #ifndef MYSQLPP_CONNECTION_H
 #define MYSQLPP_CONNECTION_H
 
-#include "platform.h"
-
-#include "defs.h"
+#include "common.h"
 
 #include "lockable.h"
 #include "noexceptions.h"

Modified: trunk/lib/const_string.h
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/const_string.h?rev=1389&r1=1388&r2=1389&view=diff
==============================================================================
--- trunk/lib/const_string.h (original)
+++ trunk/lib/const_string.h Fri Jan 12 13:41:13 2007
@@ -29,7 +29,7 @@
 #ifndef MYSQLPP_CONST_STRING_H
 #define MYSQLPP_CONST_STRING_H
 
-#include "defs.h"
+#include "common.h"
 
 #include <algorithm>
 #include <iostream>

Modified: trunk/lib/convert.h
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/convert.h?rev=1389&r1=1388&r2=1389&view=diff
==============================================================================
--- trunk/lib/convert.h (original)
+++ trunk/lib/convert.h Fri Jan 12 13:41:13 2007
@@ -31,9 +31,7 @@
 #ifndef MYSQLPP_CONVERT_H
 #define MYSQLPP_CONVERT_H
 
-#include "platform.h"
-
-#include "defs.h"
+#include "common.h"
 
 #include <stdlib.h>
 

Modified: trunk/lib/custom.pl
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/custom.pl?rev=1389&r1=1388&r2=1389&view=diff
==============================================================================
--- trunk/lib/custom.pl (original)
+++ trunk/lib/custom.pl Fri Jan 12 13:41:13 2007
@@ -57,7 +57,7 @@
 #ifndef MYSQLPP_CUSTOM_H
 #define MYSQLPP_CUSTOM_H
 
-#include "defs.h"
+#include "common.h"
 #include "tiny_int.h"
 
 #include <string>

Modified: trunk/lib/datetime.cpp
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/datetime.cpp?rev=1389&r1=1388&r2=1389&view=diff
==============================================================================
--- trunk/lib/datetime.cpp (original)
+++ trunk/lib/datetime.cpp Fri Jan 12 13:41:13 2007
@@ -26,7 +26,7 @@
 ***********************************************************************/
 
 #define MYSQLPP_NOT_HEADER
-#include "platform.h"
+#include "common.h"
 
 #include "datetime.h"
 

Modified: trunk/lib/datetime.h
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/datetime.h?rev=1389&r1=1388&r2=1389&view=diff
==============================================================================
--- trunk/lib/datetime.h (original)
+++ trunk/lib/datetime.h Fri Jan 12 13:41:13 2007
@@ -29,7 +29,7 @@
 #ifndef MYSQLPP_DATETIME_H
 #define MYSQLPP_DATETIME_H
 
-#include "defs.h"
+#include "common.h"
 
 #include "coldata.h"
 #include "stream2string.h"

Modified: trunk/lib/field_names.cpp
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/field_names.cpp?rev=1389&r1=1388&r2=1389&view=diff
==============================================================================
--- trunk/lib/field_names.cpp (original)
+++ trunk/lib/field_names.cpp Fri Jan 12 13:41:13 2007
@@ -25,7 +25,7 @@
 ***********************************************************************/
 
 #define MYSQLPP_NOT_HEADER
-#include "platform.h"
+#include "common.h"
 
 #include "field_names.h"
 

Modified: trunk/lib/field_types.cpp
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/field_types.cpp?rev=1389&r1=1388&r2=1389&view=diff
==============================================================================
--- trunk/lib/field_types.cpp (original)
+++ trunk/lib/field_types.cpp Fri Jan 12 13:41:13 2007
@@ -25,7 +25,7 @@
 ***********************************************************************/
 
 #define MYSQLPP_NOT_HEADER
-#include "platform.h"
+#include "common.h"
 
 #include "field_types.h"
 

Modified: trunk/lib/manip.h
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/manip.h?rev=1389&r1=1388&r2=1389&view=diff
==============================================================================
--- trunk/lib/manip.h (original)
+++ trunk/lib/manip.h Fri Jan 12 13:41:13 2007
@@ -42,7 +42,7 @@
 #ifndef MYSQLPP_MANIP_H
 #define MYSQLPP_MANIP_H
 
-#include "defs.h"
+#include "common.h"
 
 #include "datetime.h"
 #include "myset.h"

Modified: trunk/lib/myset.h
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/myset.h?rev=1389&r1=1388&r2=1389&view=diff
==============================================================================
--- trunk/lib/myset.h (original)
+++ trunk/lib/myset.h Fri Jan 12 13:41:13 2007
@@ -29,7 +29,7 @@
 #ifndef MYSQLPP_MYSET_H
 #define MYSQLPP_MYSET_H
 
-#include "defs.h"
+#include "common.h"
 
 #include "coldata.h"
 #include "stream2string.h"

Modified: trunk/lib/mysql++.cpp
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/mysql%2B%2B.cpp?rev=1389&r1=1388&r2=1389&view=diff
==============================================================================
--- trunk/lib/mysql++.cpp (original)
+++ trunk/lib/mysql++.cpp Fri Jan 12 13:41:13 2007
@@ -28,6 +28,8 @@
 
 namespace mysqlpp {
 
+const bool use_exceptions = true;
+
 unsigned int 
 get_library_version()
 {

Modified: trunk/lib/query.h
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/query.h?rev=1389&r1=1388&r2=1389&view=diff
==============================================================================
--- trunk/lib/query.h (original)
+++ trunk/lib/query.h Fri Jan 12 13:41:13 2007
@@ -28,7 +28,7 @@
 #ifndef MYSQLPP_QUERY_H
 #define MYSQLPP_QUERY_H
 
-#include "defs.h"
+#include "common.h"
 
 #include "lockable.h"
 #include "noexceptions.h"

Modified: trunk/lib/resiter.h
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/resiter.h?rev=1389&r1=1388&r2=1389&view=diff
==============================================================================
--- trunk/lib/resiter.h (original)
+++ trunk/lib/resiter.h Fri Jan 12 13:41:13 2007
@@ -33,7 +33,7 @@
 #ifndef MYSQLPP_RESITER_H
 #define MYSQLPP_RESITER_H
 
-#include "defs.h"
+#include "common.h"
 
 #include <iterator>
 

Modified: trunk/lib/result.h
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/result.h?rev=1389&r1=1388&r2=1389&view=diff
==============================================================================
--- trunk/lib/result.h (original)
+++ trunk/lib/result.h Fri Jan 12 13:41:13 2007
@@ -28,7 +28,7 @@
 #ifndef MYSQLPP_RESULT_H
 #define MYSQLPP_RESULT_H
 
-#include "defs.h"
+#include "common.h"
 
 #include "exceptions.h"
 #include "fields.h"

Modified: trunk/lib/sql_string.h
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/sql_string.h?rev=1389&r1=1388&r2=1389&view=diff
==============================================================================
--- trunk/lib/sql_string.h (original)
+++ trunk/lib/sql_string.h Fri Jan 12 13:41:13 2007
@@ -34,7 +34,7 @@
 #ifndef MYSQLPP_SQL_STRING_H
 #define MYSQLPP_SQL_STRING_H
 
-#include "defs.h"
+#include "common.h"
 
 #include <stdio.h>
 #include <string>

Modified: trunk/lib/sql_types.h
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/sql_types.h?rev=1389&r1=1388&r2=1389&view=diff
==============================================================================
--- trunk/lib/sql_types.h (original)
+++ trunk/lib/sql_types.h Fri Jan 12 13:41:13 2007
@@ -27,7 +27,7 @@
 #if !defined(MYSQLPP_SQL_TYPES_H)
 #define MYSQLPP_SQL_TYPES_H
 
-#include "defs.h"
+#include "common.h"
 #include "myset.h"
 
 #include <string>

Modified: trunk/lib/string_util.h
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/string_util.h?rev=1389&r1=1388&r2=1389&view=diff
==============================================================================
--- trunk/lib/string_util.h (original)
+++ trunk/lib/string_util.h Fri Jan 12 13:41:13 2007
@@ -29,7 +29,7 @@
 #ifndef MYSQLPP_STRING_UTIL_H
 #define MYSQLPP_STRING_UTIL_H
 
-#include "defs.h"
+#include "common.h"
 
 #include <ctype.h>
 

Modified: trunk/lib/transaction.cpp
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/transaction.cpp?rev=1389&r1=1388&r2=1389&view=diff
==============================================================================
--- trunk/lib/transaction.cpp (original)
+++ trunk/lib/transaction.cpp Fri Jan 12 13:41:13 2007
@@ -24,7 +24,7 @@
 ***********************************************************************/
 
 #define MYSQLPP_NOT_HEADER
-#include "platform.h"
+#include "common.h"
 
 #include "transaction.h"
 

Modified: trunk/lib/transaction.h
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/transaction.h?rev=1389&r1=1388&r2=1389&view=diff
==============================================================================
--- trunk/lib/transaction.h (original)
+++ trunk/lib/transaction.h Fri Jan 12 13:41:13 2007
@@ -31,7 +31,7 @@
 #if !defined(MYSQLPP_TRANSACTION_H)
 #define MYSQLPP_TRANSACTION_H
 
-#include "platform.h"
+#include "common.h"
 
 namespace mysqlpp {
 

Modified: trunk/lib/type_info.cpp
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/type_info.cpp?rev=1389&r1=1388&r2=1389&view=diff
==============================================================================
--- trunk/lib/type_info.cpp (original)
+++ trunk/lib/type_info.cpp Fri Jan 12 13:41:13 2007
@@ -24,7 +24,7 @@
  USA
 ***********************************************************************/
 
-#include "platform.h"
+#include "common.h"
 
 #include "datetime.h"
 #include "sql_types.h"

Modified: trunk/lib/type_info.h
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/type_info.h?rev=1389&r1=1388&r2=1389&view=diff
==============================================================================
--- trunk/lib/type_info.h (original)
+++ trunk/lib/type_info.h Fri Jan 12 13:41:13 2007
@@ -31,7 +31,7 @@
 #ifndef MYSQLPP_TYPE_INFO_H
 #define MYSQLPP_TYPE_INFO_H
 
-#include "defs.h"
+#include "common.h"
 
 #include <mysql.h>
 


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

Reply via email to