Author: wyoung
Date: Tue Jul 10 05:14:16 2007
New Revision: 1652

URL: http://svn.gna.org/viewcvs/mysqlpp?rev=1652&view=rev
Log:
Wrapped the #includes for MySQL headers in an ifdef that makes the code
look for the headers in a mysql subdirectory of some directory the
compiler looks in for headers already.  This is a common pattern on
Linux, where binary packages usually put them in /usr/include/mysql.
This lets you avoid adding /usr/include/mysql to your general include
path, so you don't pull in the wrong thing accidentally.

Modified:
    trunk/lib/common.h

Modified: trunk/lib/common.h
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/common.h?rev=1652&r1=1651&r2=1652&view=diff
==============================================================================
--- trunk/lib/common.h (original)
+++ trunk/lib/common.h Tue Jul 10 05:14:16 2007
@@ -33,8 +33,6 @@
 
 #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)
@@ -85,6 +83,12 @@
 
        // Make DLL stuff a no-op on this platform.
        #define MYSQLPP_EXPORT
+#endif
+
+#if defined(MYSQLPP_MYSQL_HEADERS_BURIED)
+#      include <mysql/mysql_version.h>
+#else
+#      include <mysql_version.h>
 #endif
 
 namespace mysqlpp {
@@ -139,8 +143,12 @@
 // 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>
+// developer docs, which recommend including my_global.h before mysql.h.
+#if defined(MYSQLPP_MYSQL_HEADERS_BURIED)
+#      include <mysql/mysql.h>
+#else
+#      include <mysql.h>
+#endif
 
 
 namespace mysqlpp {


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

Reply via email to