Author: mysqlpp
Date: Wed Apr  5 03:32:22 2006
New Revision: 1281

URL: http://svn.gna.org/viewcvs/mysqlpp?rev=1281&view=rev
Log:
Added -v flag to custom.pl script, to suppress use of Viktor Stark's
multiply defined static variable linking fix.  It relies on variadic
macros, which is not supported by Visual C++ 2003, at least.  If you
don't throw the flag, we generate an ifdef to check that generates an
error message informing them of the problem if we detect an older
version of Visual C++.

Modified:
    trunk/lib/custom.pl

Modified: trunk/lib/custom.pl
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/custom.pl?rev=1281&r1=1280&r2=1281&view=diff
==============================================================================
--- trunk/lib/custom.pl (original)
+++ trunk/lib/custom.pl Wed Apr  5 03:32:22 2006
@@ -39,6 +39,10 @@
 # No user-serviceable parts below.
 
 use strict;
+use Getopt::Std;
+
+our ($opt_v);
+getopts('v') or die "usage: custom.pl [-v]\n";
 
 open (OUT0, ">custom.h");
 open (OUT, ">custom-macros.h");
@@ -57,13 +61,28 @@
 #include "tiny_int.h"
 
 #include <string>
+---
+
+my ($suppress_statics_start, $suppress_statics_end) = ('', '');
+unless ($opt_v) {
+       print OUT0 << "---";
+
+#if _MSC_VER < 1400
+#      error Please run the MySQL++ script lib/custom.pl with the -v 
compatibility flag.
+#endif
 
 #ifdef MYSQLPP_SSQLS_NO_STATICS
-#define MYSQLPP_SSQLS_EXPAND(...)
+#      define MYSQLPP_SSQLS_EXPAND(...)
 #else
-#define MYSQLPP_SSQLS_EXPAND(...) __VA_ARGS__
+#      define MYSQLPP_SSQLS_EXPAND(...) __VA_ARGS__
 #endif
 
+---
+       $suppress_statics_start = 'MYSQLPP_SSQLS_EXPAND(';
+       $suppress_statics_end = ')';
+}
+
+print OUT0 << "---";
 namespace mysqlpp {
 
 enum sql_dummy_type {sql_dummy};
@@ -648,11 +667,12 @@
     NAME##_cus_equal_list<Manip> equal_list(mysqlpp::cchar *d, mysqlpp::cchar 
*c, Manip m, 
                                            mysqlpp::sql_cmp_type sc) const;
   }; 
-  MYSQLPP_SSQLS_EXPAND(
+  $suppress_statics_start
   const char *NAME::names[] = { 
 $names 
   }; 
-  const char *NAME::_table = #NAME ;)
+  const char *NAME::_table = #NAME ;
+  $suppress_statics_end
 
   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