Boost logo

Boost-Commit :

From: chris_at_[hidden]
Date: 2007-10-21 01:46:16


Author: chris_kohlhoff
Date: 2007-10-21 01:46:15 EDT (Sun, 21 Oct 2007)
New Revision: 40255
URL: http://svn.boost.org/trac/boost/changeset/40255

Log:
HP-UX fails to declare if_nametoindex and if_indextoname as extern "C".
Added declarations for them with correct linkage to avoid linker errors.

Text files modified:
   trunk/boost/asio/detail/socket_ops.hpp | 7 +++++++
   1 files changed, 7 insertions(+), 0 deletions(-)

Modified: trunk/boost/asio/detail/socket_ops.hpp
==============================================================================
--- trunk/boost/asio/detail/socket_ops.hpp (original)
+++ trunk/boost/asio/detail/socket_ops.hpp 2007-10-21 01:46:15 EDT (Sun, 21 Oct 2007)
@@ -40,6 +40,13 @@
 struct msghdr { int msg_namelen; };
 #endif // defined(BOOST_WINDOWS) || defined(__CYGWIN__)
 
+#if defined(__hpux)
+// HP-UX doesn't declare these functions extern "C", so they are declared again
+// here to avoid linker errors about undefined symbols.
+extern "C" char* if_indextoname(unsigned int, char*);
+extern "C" unsigned int if_nametoindex(const char*);
+#endif // defined(__hpux)
+
 inline void clear_error(boost::system::error_code& ec)
 {
   errno = 0;


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk