Author: wyoung
Date: Thu Jan 3 08:56:50 2008
New Revision: 2069
URL: http://svn.gna.org/viewcvs/mysqlpp?rev=2069&view=rev
Log:
VC++ 2003 fixes
Modified:
trunk/examples/cgi_jpeg.cpp
trunk/examples/for_each.cpp
trunk/examples/store_if.cpp
trunk/examples/transaction.cpp
trunk/lib/common.h
trunk/mysql++.bkl
Modified: trunk/examples/cgi_jpeg.cpp
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/examples/cgi_jpeg.cpp?rev=2069&r1=2068&r2=2069&view=diff
==============================================================================
--- trunk/examples/cgi_jpeg.cpp (original)
+++ trunk/examples/cgi_jpeg.cpp Thu Jan 3 08:56:50 2008
@@ -38,14 +38,20 @@
#define IMG_USER "root"
#define IMG_PASSWORD "nunyabinness"
+#if defined(MYSQLPP_SSQLS_COMPATIBLE)
sql_create_2(images,
1, 2,
mysqlpp::sql_int_unsigned, id,
mysqlpp::sql_blob, data)
+#endif
-int
-main()
+#if defined(MYSQLPP_SSQLS_COMPATIBLE)
+int main()
+#else
+int main(int argc, char* argv[])
+#endif
{
+#if defined(MYSQLPP_SSQLS_COMPATIBLE)
unsigned int img_id = 0;
char* cgi_query = getenv("QUERY_STRING");
if (cgi_query) {
@@ -104,6 +110,11 @@
cout << "GENERAL ERROR: " << er.what() << endl;
return 1;
}
+#else
+ // MySQL++ works under Visual C++ 2003 with only one excpetion,
+ // SSQLS, so we have to stub out the examples to avoid build errors.
+ cout << argv[0] << " requires Visual C++ 2005 or newer." << endl;
+#endif
return 0;
}
Modified: trunk/examples/for_each.cpp
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/examples/for_each.cpp?rev=2069&r1=2068&r2=2069&view=diff
==============================================================================
--- trunk/examples/for_each.cpp (original)
+++ trunk/examples/for_each.cpp Thu Jan 3 08:56:50 2008
@@ -37,6 +37,7 @@
// Define a functor to collect statistics about the stock table
+#if defined(MYSQLPP_SSQLS_COMPATIBLE)
class gather_stock_stats
{
public:
@@ -73,11 +74,13 @@
"costing " << ss.cost_ << " cowrie shells";
return os;
}
+#endif // defined(MYSQLPP_SSQLS_COMPATIBLE)
int
main(int argc, char *argv[])
{
+#if defined(MYSQLPP_SSQLS_COMPATIBLE)
// Get database access parameters from command line
const char* db = 0, *server = 0, *user = 0, *pass = "";
if (!parse_command_line(argc, argv, &db, &server, &user, &pass)) {
@@ -103,6 +106,11 @@
std::cerr << "Error: " << er.what() << std::endl;
return 1;
}
+#else
+ // MySQL++ works under Visual C++ 2003 with only one excpetion,
+ // SSQLS, so we have to stub out the examples to avoid build errors.
+ std::cout << argv[0] << " requires Visual C++ 2005 or newer." <<
std::endl;
+#endif
return 0;
}
Modified: trunk/examples/store_if.cpp
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/examples/store_if.cpp?rev=2069&r1=2068&r2=2069&view=diff
==============================================================================
--- trunk/examples/store_if.cpp (original)
+++ trunk/examples/store_if.cpp Thu Jan 3 08:56:50 2008
@@ -37,6 +37,7 @@
#include <math.h>
+#if defined(MYSQLPP_SSQLS_COMPATIBLE)
// Define a functor for testing primality.
struct is_prime
{
@@ -60,11 +61,13 @@
}
}
};
+#endif // defined(MYSQLPP_SSQLS_COMPATIBLE)
int
main(int argc, char *argv[])
{
+#if defined(MYSQLPP_SSQLS_COMPATIBLE)
// Get database access parameters from command line
const char* db = 0, *server = 0, *user = 0, *pass = "";
if (!parse_command_line(argc, argv, &db, &server, &user, &pass)) {
@@ -98,6 +101,11 @@
std::cerr << "Error: " << er.what() << std::endl;
return 1;
}
+#else
+ // MySQL++ works under Visual C++ 2003 with only one excpetion,
+ // SSQLS, so we have to stub out the examples to avoid build errors.
+ std::cout << argv[0] << " requires Visual C++ 2005 or newer." <<
std::endl;
+#endif
return 0;
}
Modified: trunk/examples/transaction.cpp
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/examples/transaction.cpp?rev=2069&r1=2068&r2=2069&view=diff
==============================================================================
--- trunk/examples/transaction.cpp (original)
+++ trunk/examples/transaction.cpp Thu Jan 3 08:56:50 2008
@@ -36,6 +36,7 @@
int
main(int argc, char *argv[])
{
+#if defined(MYSQLPP_SSQLS_COMPATIBLE)
// Get database access parameters from command line
const char* db = 0, *server = 0, *user = 0, *pass = "";
if (!parse_command_line(argc, argv, &db, &server, &user, &pass)) {
@@ -102,6 +103,11 @@
cerr << "Error: " << er.what() << endl;
return -1;
}
+#else
+ // MySQL++ works under Visual C++ 2003 with only one excpetion,
+ // SSQLS, so we have to stub out the examples to avoid build errors.
+ cout << argv[0] << " requires Visual C++ 2005 or newer." << endl;
+#endif
return 0;
}
Modified: trunk/lib/common.h
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/common.h?rev=2069&r1=2068&r2=2069&view=diff
==============================================================================
--- trunk/lib/common.h (original)
+++ trunk/lib/common.h Thu Jan 3 08:56:50 2008
@@ -57,6 +57,7 @@
# if defined(_MSC_VER)
# define MYSQLPP_PLATFORM_VISUAL_CPP
# if _MSC_VER < 1400
+# undef MYSQLPP_QUERY_THISPTR
# define MYSQLPP_QUERY_THISPTR
dynamic_cast<std::ostream&>(*this)
# undef MYSQLPP_SSQLS_COMPATIBLE
# elif !defined(_STLP_VERSION) && !defined(_STLP_VERSION_STR)
Modified: trunk/mysql++.bkl
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/mysql%2B%2B.bkl?rev=2069&r1=2068&r2=2069&view=diff
==============================================================================
--- trunk/mysql++.bkl (original)
+++ trunk/mysql++.bkl Thu Jan 3 08:56:50 2008
@@ -168,7 +168,7 @@
<lib-path>$(BUILD)</lib-path>
<include>$(MYSQL_WIN_DIR)\include</include>
<lib-path>$(MYSQL_WIN_DIR)\lib\opt</lib-path>
- <sys-lib>mysqlpp</sys-lib>
+ <sys-lib>mysqlpp$(DEBUG_SUFFIX)</sys-lib>
<sys-lib>libmysql</sys-lib>
</if>
@@ -181,7 +181,7 @@
<include>"$(MYSQL_WIN_DIR)\include"</include>
<lib-path>"$(MYSQL_WIN_DIR)\lib\opt"</lib-path>
<sys-lib>mysqlclient</sys-lib>
- <sys-lib>mysqlpp</sys-lib>
+ <sys-lib>mysqlpp$(DEBUG_SUFFIX)</sys-lib>
</if>
<if cond="FORMAT=='autoconf'">
@@ -211,9 +211,12 @@
<exe id="test_manip" template="programs">
<sources>test/manip.cpp</sources>
</exe>
- <exe id="test_string" template="programs">
- <sources>test/string.cpp</sources>
- </exe>
+ <if cond="FORMAT!='msvs2003prj'">
+ <!-- VC++ 2003 can't compile this -->
+ <exe id="test_string" template="programs">
+ <sources>test/string.cpp</sources>
+ </exe>
+ </if>
<exe id="test_tcp" template="programs">
<sources>test/tcp.cpp</sources>
</exe>
_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits