From bbf3a233d786cc55768630c9009b9f447ad27851 Mon Sep 17 00:00:00 2001 From: chris_kohlhoff Date: Mon, 29 Oct 2007 12:46:17 +0000 Subject: [PATCH] HP-UX fails to declare if_nametoindex as extern "C". Added a declaration for it with correct linkage to avoid a linker error. --- asio/src/tests/unit/ip/multicast.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/asio/src/tests/unit/ip/multicast.cpp b/asio/src/tests/unit/ip/multicast.cpp index 9dfc9a67..224687b5 100644 --- a/asio/src/tests/unit/ip/multicast.cpp +++ b/asio/src/tests/unit/ip/multicast.cpp @@ -104,6 +104,12 @@ void test() namespace ip_multicast_runtime { +#if defined(__hpux) +// HP-UX doesn't declare this function extern "C", so it is declared again here +// to avoid a linker errors about an undefined symbol. +extern "C" unsigned int if_nametoindex(const char*); +#endif // defined(__hpux) + void test() { using namespace asio;