List:MySQL++« Previous MessageNext Message »
From:dengxy@cse.buaa.edu.cn Date:June 9 2006 3:37am
Subject:Re: mysql++ build failed toward MinGW + STLport 5+
View as plain text  
To Warren Young:

Francois Dumont, the STLport developer, also provide another walk around
today that makes it work with the template expression feature, which
gains superior performance when concatenating std::strings using
operator+ in STLport, however, at a cost to produce default SQLString
objects in manip.cpp.

Here is the patch using his walk around:
*************patch begin***************


--- mysql++/lib/manip.cpp 2006-04-05 12:44:49.000000000 +0800
+++ ./manip.cpp 2006-06-09 11:26:38.347625000 +0800
@@ -56,8 +56,9 @@
SQLQueryParms& operator <<(quote_type2 p, SQLString& in)
{
if (in.is_string) {
+ SQLString in2;
if (in.dont_escape) {
- SQLString in2 = '\'' + in + '\'';
+ in2 = '\'' + in + '\'';
in2.processed = true;
return *p.qparms << in2;
}
@@ -65,7 +66,7 @@
char* s = new char[in.size() * 2 + 1];
mysql_escape_string(s, in.c_str(),
static_cast<unsigned long>(in.size()));
- SQLString in2 = SQLString('\'') + s + '\'';
+ in2 = SQLString('\'') + s + '\'';
in2.processed = true;
*p.qparms << in2;
delete[] s;
@@ -305,7 +306,8 @@
SQLQueryParms& operator <<(quote_only_type2 p, SQLString& in)
{
if (in.is_string) {
- SQLString in2 = '\'' + in + '\'';
+ SQLString in2;
+ in2 = '\'' + in + '\'';
in2.processed = true;
return *p.qparms << in2;
}
@@ -363,7 +365,8 @@
SQLQueryParms& operator <<(quote_double_only_type2 p, SQLString& in)
{
if (in.is_string) {
- SQLString in2 = "\"" + in + "\"";
+ SQLString in2;
+ in2 = "\"" + in + "\"";
in2.processed = true;
return *p.qparms << in2;
}


*************patch end***************
By this patch applied, STLport can compile mysql++ without problem, too!
However, it is you who decide whether to use this patch :)
Thread
mysql++ build failed toward MinGW + STLport 5+dengxy@cse.buaa.edu.cn18 May
  • Re: mysql++ build failed toward MinGW + STLport 5+Warren Young19 May
    • Re: mysql++ build failed toward MinGW + STLport 5+dengxy@cse.buaa.edu.cn19 May
    • Re: mysql++ build failed toward MinGW + STLport 5+dengxy@cse.buaa.edu.cn8 Jun
      • Re: mysql++ build failed toward MinGW + STLport 5+Warren Young8 Jun
    • Re: mysql++ build failed toward MinGW + STLport 5+dengxy@cse.buaa.edu.cn9 Jun
      • Re: mysql++ build failed toward MinGW + STLport 5+Warren Young26 Jun