[mdns] Modernize to C++17 nested namespace syntax (#11983)

This commit is contained in:
J. Nick Koston
2025-11-20 07:57:33 -06:00
committed by GitHub
parent 4825da8e9c
commit 5071473767
7 changed files with 14 additions and 28 deletions

View File

@@ -21,8 +21,7 @@
#include "esphome/components/dashboard_import/dashboard_import.h"
#endif
namespace esphome {
namespace mdns {
namespace esphome::mdns {
static const char *const TAG = "mdns";
@@ -189,6 +188,5 @@ void MDNSComponent::dump_config() {
#endif
}
} // namespace mdns
} // namespace esphome
} // namespace esphome::mdns
#endif

View File

@@ -6,8 +6,7 @@
#include "esphome/core/component.h"
#include "esphome/core/helpers.h"
namespace esphome {
namespace mdns {
namespace esphome::mdns {
// Helper struct that identifies strings that may be stored in flash storage (similar to LogString)
struct MDNSString;
@@ -79,6 +78,5 @@ class MDNSComponent : public Component {
void compile_records_(StaticVector<MDNSService, MDNS_SERVICE_COUNT> &services);
};
} // namespace mdns
} // namespace esphome
} // namespace esphome::mdns
#endif

View File

@@ -7,8 +7,7 @@
#include "esphome/core/log.h"
#include "mdns_component.h"
namespace esphome {
namespace mdns {
namespace esphome::mdns {
static const char *const TAG = "mdns";
@@ -56,7 +55,6 @@ void MDNSComponent::on_shutdown() {
delay(40); // Allow the mdns packets announcing service removal to be sent
}
} // namespace mdns
} // namespace esphome
} // namespace esphome::mdns
#endif // USE_ESP32

View File

@@ -9,8 +9,7 @@
#include "esphome/core/log.h"
#include "mdns_component.h"
namespace esphome {
namespace mdns {
namespace esphome::mdns {
void MDNSComponent::setup() {
#ifdef USE_MDNS_STORE_SERVICES
@@ -52,7 +51,6 @@ void MDNSComponent::on_shutdown() {
delay(10);
}
} // namespace mdns
} // namespace esphome
} // namespace esphome::mdns
#endif

View File

@@ -6,8 +6,7 @@
#include "esphome/core/log.h"
#include "mdns_component.h"
namespace esphome {
namespace mdns {
namespace esphome::mdns {
void MDNSComponent::setup() {
// Host platform doesn't have actual mDNS implementation
@@ -15,7 +14,6 @@ void MDNSComponent::setup() {
void MDNSComponent::on_shutdown() {}
} // namespace mdns
} // namespace esphome
} // namespace esphome::mdns
#endif

View File

@@ -9,8 +9,7 @@
#include <mDNS.h>
namespace esphome {
namespace mdns {
namespace esphome::mdns {
void MDNSComponent::setup() {
#ifdef USE_MDNS_STORE_SERVICES
@@ -46,7 +45,6 @@ void MDNSComponent::setup() {
void MDNSComponent::on_shutdown() {}
} // namespace mdns
} // namespace esphome
} // namespace esphome::mdns
#endif

View File

@@ -9,8 +9,7 @@
#include <ESP8266mDNS.h>
namespace esphome {
namespace mdns {
namespace esphome::mdns {
void MDNSComponent::setup() {
#ifdef USE_MDNS_STORE_SERVICES
@@ -51,7 +50,6 @@ void MDNSComponent::on_shutdown() {
delay(40);
}
} // namespace mdns
} // namespace esphome
} // namespace esphome::mdns
#endif