]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[4277] Fixed tagged_statements name collision
authorThomas Markwalder <tmark@isc.org>
Thu, 14 Jul 2016 20:35:12 +0000 (16:35 -0400)
committerThomas Markwalder <tmark@isc.org>
Thu, 14 Jul 2016 20:35:12 +0000 (16:35 -0400)
Wrapped declaration of tagged_statements[] in pgsql_host_data_source.cc
and mysql_host_data_source.cc in anonymous namespace.  They collide
otherwise.

src/lib/dhcpsrv/mysql_host_data_source.cc
src/lib/dhcpsrv/pgsql_host_data_source.cc

index 7e2b3e423df51d9ff9efbb5848b83762d9217b19..13748dcf2c8ef76b61944f1eac6d7f6c2a0b5a51 100644 (file)
@@ -1779,6 +1779,7 @@ public:
 
 };
 
+namespace {
 /// @brief Prepared MySQL statements used by the backend to insert and
 /// retrieve hosts from the database.
 TaggedStatement tagged_statements[] = {
@@ -1934,6 +1935,8 @@ TaggedStatement tagged_statements[] = {
     {MySqlHostDataSourceImpl::NUM_STATEMENTS, NULL}
 };
 
+}; // end anonymouse namespace
+
 MySqlHostDataSourceImpl::
 MySqlHostDataSourceImpl(const MySqlConnection::ParameterMap& parameters)
     : host_exchange_(new MySqlHostWithOptionsExchange(MySqlHostWithOptionsExchange::DHCP4_ONLY)),
index ee0d9c3ed79b1020e7ff035bfbe960c5e144c1df..080de03bf37e029a4baf5335e076012cd1a3f18c 100644 (file)
@@ -1260,8 +1260,10 @@ public:
 
 };
 
-/// @brief Prepared MySQL statements used by the backend to insert and
-/// retrieve hosts from the database.
+namespace {
+
+/// @brief Prepared PosgreSQL statements used by the backend to insert and
+/// retrieve reservation data from the database.
 PgSqlTaggedStatement tagged_statements[] = {
     // PgSqlHostDataSourceImpl::INSERT_HOST
     // Inserts a host into the 'hosts' table. Returns the inserted host id.
@@ -1447,6 +1449,8 @@ PgSqlTaggedStatement tagged_statements[] = {
     {0, { 0 }, NULL, NULL}
 };
 
+}; // end anonymous namespace
+
 PgSqlHostDataSourceImpl::
 PgSqlHostDataSourceImpl(const PgSqlConnection::ParameterMap& parameters)
     : host_exchange_(new PgSqlHostWithOptionsExchange(PgSqlHostWithOptionsExchange::DHCP4_ONLY)),