From 41257c60f2439b9119e71becbf969f9932100f22 Mon Sep 17 00:00:00 2001 From: "Fiorentino Ing. Stefano" Date: Mon, 5 Oct 2020 07:34:43 +0000 Subject: [PATCH] Avoid instantiations as header-only config is used. Closes #221 Signed-off-by: Fiorentino Ing. Stefano --- src/uvw/dns.cpp | 4 ++-- src/uvw/dns.h | 4 ++-- src/uvw/loop.cpp | 4 ++-- src/uvw/loop.h | 4 ++-- src/uvw/tcp.cpp | 4 ++-- src/uvw/tcp.h | 4 ++-- src/uvw/udp.cpp | 4 ++-- src/uvw/udp.h | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/uvw/dns.cpp b/src/uvw/dns.cpp index 1294abef..1f22caf6 100644 --- a/src/uvw/dns.cpp +++ b/src/uvw/dns.cpp @@ -129,7 +129,7 @@ UVW_INLINE std::pair> GetNameInfoReq // explicit instantiations - +#ifdef UVW_AS_LIB template void GetNameInfoReq::nameInfo(std::string ip, unsigned int port, int flags); template void GetNameInfoReq::nameInfo(std::string ip, unsigned int port, int flags); @@ -141,6 +141,6 @@ template std::pair> GetNameInfoReq:: template std::pair> GetNameInfoReq::nameInfoSync(Addr addr, int flags); template std::pair> GetNameInfoReq::nameInfoSync(Addr addr, int flags); - +#endif // UVW_AS_LIB } diff --git a/src/uvw/dns.h b/src/uvw/dns.h index 5c91c521..1800f898 100644 --- a/src/uvw/dns.h +++ b/src/uvw/dns.h @@ -237,7 +237,7 @@ public: // (extern) explicit instantiations - +#ifdef UVW_AS_LIB extern template void GetNameInfoReq::nameInfo(std::string ip, unsigned int port, int flags); extern template void GetNameInfoReq::nameInfo(std::string ip, unsigned int port, int flags); @@ -249,7 +249,7 @@ extern template std::pair> GetNameIn extern template std::pair> GetNameInfoReq::nameInfoSync(Addr addr, int flags); extern template std::pair> GetNameInfoReq::nameInfoSync(Addr addr, int flags); - +#endif // UVW_AS_LIB /** * Internal details not to be documented. diff --git a/src/uvw/loop.cpp b/src/uvw/loop.cpp index 5943b75a..9b609186 100644 --- a/src/uvw/loop.cpp +++ b/src/uvw/loop.cpp @@ -137,10 +137,10 @@ UVW_INLINE uv_loop_t *Loop::raw() noexcept { // explicit instantiations - +#ifdef UVW_AS_LIB template bool Loop::run() noexcept; template bool Loop::run() noexcept; template bool Loop::run() noexcept; - +#endif // UVW_AS_LIB } diff --git a/src/uvw/loop.h b/src/uvw/loop.h index 74746362..d366e58d 100644 --- a/src/uvw/loop.h +++ b/src/uvw/loop.h @@ -417,11 +417,11 @@ private: // (extern) explicit instantiations - +#ifdef UVW_AS_LIB extern template bool Loop::run() noexcept; extern template bool Loop::run() noexcept; extern template bool Loop::run() noexcept; - +#endif // UVW_AS_LIB } diff --git a/src/uvw/tcp.cpp b/src/uvw/tcp.cpp index 05f2d058..a1b0ec28 100644 --- a/src/uvw/tcp.cpp +++ b/src/uvw/tcp.cpp @@ -102,7 +102,7 @@ UVW_INLINE void TCPHandle::closeReset() { // explicit instantiations - +#ifdef UVW_AS_LIB template void TCPHandle::bind(std::string, unsigned int, Flags); template void TCPHandle::bind(std::string, unsigned int, Flags); @@ -120,6 +120,6 @@ template void TCPHandle::connect(std::string, unsigned int); template void TCPHandle::connect(Addr addr); template void TCPHandle::connect(Addr addr); - +#endif // UVW_AS_LIB } diff --git a/src/uvw/tcp.h b/src/uvw/tcp.h index 9631426f..cd023948 100644 --- a/src/uvw/tcp.h +++ b/src/uvw/tcp.h @@ -237,7 +237,7 @@ private: // (extern) explicit instantiations - +#ifdef UVW_AS_LIB extern template void TCPHandle::bind(std::string, unsigned int, Flags); extern template void TCPHandle::bind(std::string, unsigned int, Flags); @@ -255,7 +255,7 @@ extern template void TCPHandle::connect(std::string, unsigned int); extern template void TCPHandle::connect(Addr addr); extern template void TCPHandle::connect(Addr addr); - +#endif // UVW_AS_LIB /** * Internal details not to be documented. diff --git a/src/uvw/udp.cpp b/src/uvw/udp.cpp index 6cc0d1f4..f68ce4b3 100644 --- a/src/uvw/udp.cpp +++ b/src/uvw/udp.cpp @@ -264,7 +264,7 @@ UVW_INLINE size_t UDPHandle::sendQueueCount() const noexcept { // explicit instantiations - +#ifdef UVW_AS_LIB template void UDPHandle::connect(std::string, unsigned int); template void UDPHandle::connect(std::string, unsigned int); @@ -321,6 +321,6 @@ template int UDPHandle::trySend(Addr, char *, unsigned int); template void UDPHandle::recv(); template void UDPHandle::recv(); - +#endif // UVW_AS_LIB } diff --git a/src/uvw/udp.h b/src/uvw/udp.h index 94942c9c..e4090a22 100644 --- a/src/uvw/udp.h +++ b/src/uvw/udp.h @@ -586,7 +586,7 @@ private: // (extern) explicit instantiations - +#ifdef UVW_AS_LIB extern template void UDPHandle::connect(std::string, unsigned int); extern template void UDPHandle::connect(std::string, unsigned int); @@ -643,7 +643,7 @@ extern template int UDPHandle::trySend(Addr, char *, unsigned int); extern template void UDPHandle::recv(); extern template void UDPHandle::recv(); - +#endif // UVW_AS_LIB /** * Internal details not to be documented.