Browse Source

[4277] Fixed tagged_statements name collision

Wrapped declaration of tagged_statements[] in pgsql_host_data_source.cc
and mysql_host_data_source.cc in anonymous namespace.  They collide
otherwise.
Thomas Markwalder 8 years ago
parent
commit
cac472f52a

+ 3 - 0
src/lib/dhcpsrv/mysql_host_data_source.cc

@@ -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)),

+ 6 - 2
src/lib/dhcpsrv/pgsql_host_data_source.cc

@@ -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)),