Author: wyoung
Date: Sat Mar  4 09:51:29 2006
New Revision: 1221

URL: http://svn.gna.org/viewcvs/mysqlpp?rev=1221&view=rev
Log:
If you #define MYSQLPP_SSQLS_NO_STATICS before using one of the
sql_create_? macros, it will not define the static _table and
names members.  This allows you to use these macros in header files to
declare SSQLS structures used in several program modules, while avoiding
multiple static member definition errors.  Patch by Viktor Stark
<[EMAIL PROTECTED]>.

Modified:
    branches/v2.1-bakefile/lib/custom.pl

Modified: branches/v2.1-bakefile/lib/custom.pl
URL: 
http://svn.gna.org/viewcvs/mysqlpp/branches/v2.1-bakefile/lib/custom.pl?rev=1221&r1=1220&r2=1221&view=diff
==============================================================================
--- branches/v2.1-bakefile/lib/custom.pl (original)
+++ branches/v2.1-bakefile/lib/custom.pl Sat Mar  4 09:51:29 2006
@@ -57,6 +57,12 @@
 #include "tiny_int.h"
 
 #include <string>
+
+#ifdef MYSQLPP_SSQLS_NO_STATICS
+#define MYSQLPP_SSQLS_EXPAND(a...)
+#else
+#define MYSQLPP_SSQLS_EXPAND(a...) a
+#endif
 
 namespace mysqlpp {
 
@@ -642,11 +648,11 @@
     NAME##_cus_equal_list<Manip> equal_list(mysqlpp::cchar *d, mysqlpp::cchar 
*c, Manip m, 
                                            mysqlpp::sql_cmp_type sc) const;
   }; 
-
+  MYSQLPP_SSQLS_EXPAND(
   const char *NAME::names[] = { 
 $names 
   }; 
-  const char *NAME::_table = #NAME ;  
+  const char *NAME::_table = #NAME ;)
 
   template <class Manip>
   NAME##_cus_value_list<Manip>::NAME##_cus_value_list


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

Reply via email to