From 8dab93615f921f5621676c820fc1ef85602d50fd Mon Sep 17 00:00:00 2001 From: Costyn van Dongen Date: Sun, 19 Oct 2025 22:57:53 +0200 Subject: [PATCH] fix: Template specializations in ArtnetWiFi.h cause multiple definition linker errors in multi-file C++ projects --- ArtnetETH.h | 8 ++++---- ArtnetEther.h | 8 ++++---- ArtnetEtherENC.h | 8 ++++---- ArtnetNativeEther.h | 8 ++++---- ArtnetWiFi.h | 8 ++++---- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/ArtnetETH.h b/ArtnetETH.h index 9330ba6..30c8446 100644 --- a/ArtnetETH.h +++ b/ArtnetETH.h @@ -41,25 +41,25 @@ struct MacAddress }; template <> -IPAddress getLocalIP() +inline IPAddress getLocalIP() { return LocalIP::get(ETH); } template <> -IPAddress getSubnetMask() +inline IPAddress getSubnetMask() { return SubnetMask::get(ETH); } template <> -void getMacAddress(uint8_t mac[6]) +inline void getMacAddress(uint8_t mac[6]) { MacAddress::get(ETH, mac); } template <> -bool isNetworkReady() +inline bool isNetworkReady() { return true; } diff --git a/ArtnetEther.h b/ArtnetEther.h index 1c0eca6..e2012e6 100644 --- a/ArtnetEther.h +++ b/ArtnetEther.h @@ -40,25 +40,25 @@ struct MacAddress }; template <> -IPAddress getLocalIP() +inline IPAddress getLocalIP() { return LocalIP::get(Ethernet); } template <> -IPAddress getSubnetMask() +inline IPAddress getSubnetMask() { return SubnetMask::get(Ethernet); } template <> -void getMacAddress(uint8_t mac[6]) +inline void getMacAddress(uint8_t mac[6]) { MacAddress::get(Ethernet, mac); } template <> -bool isNetworkReady() +inline bool isNetworkReady() { return true; } diff --git a/ArtnetEtherENC.h b/ArtnetEtherENC.h index aec6370..2b0fefa 100644 --- a/ArtnetEtherENC.h +++ b/ArtnetEtherENC.h @@ -40,25 +40,25 @@ struct MacAddress }; template <> -IPAddress getLocalIP() +inline IPAddress getLocalIP() { return LocalIP::get(Ethernet); } template <> -IPAddress getSubnetMask() +inline IPAddress getSubnetMask() { return SubnetMask::get(Ethernet); } template <> -void getMacAddress(uint8_t mac[6]) +inline void getMacAddress(uint8_t mac[6]) { MacAddress::get(Ethernet, mac); } template <> -bool isNetworkReady() +inline bool isNetworkReady() { return true; } diff --git a/ArtnetNativeEther.h b/ArtnetNativeEther.h index 9b95de8..cd2f2ae 100644 --- a/ArtnetNativeEther.h +++ b/ArtnetNativeEther.h @@ -40,25 +40,25 @@ struct MacAddress }; template <> -IPAddress getLocalIP() +inline IPAddress getLocalIP() { return LocalIP::get(Ethernet); } template <> -IPAddress getSubnetMask() +inline IPAddress getSubnetMask() { return SubnetMask::get(Ethernet); } template <> -void getMacAddress(uint8_t mac[6]) +inline void getMacAddress(uint8_t mac[6]) { MacAddress::get(Ethernet, mac); } template <> -bool isNetworkReady() +inline bool isNetworkReady() { return true; } diff --git a/ArtnetWiFi.h b/ArtnetWiFi.h index bd48194..681d1e3 100644 --- a/ArtnetWiFi.h +++ b/ArtnetWiFi.h @@ -99,25 +99,25 @@ struct IsNetworkReady }; template <> -IPAddress getLocalIP() +inline IPAddress getLocalIP() { return LocalIP::get(WiFi); } template <> -IPAddress getSubnetMask() +inline IPAddress getSubnetMask() { return SubnetMask::get(WiFi); } template <> -void getMacAddress(uint8_t mac[6]) +inline void getMacAddress(uint8_t mac[6]) { MacAddress::get(WiFi, mac); } template <> -bool isNetworkReady() +inline bool isNetworkReady() { return IsNetworkReady::get(WiFi); }