diff options
author | Josh Blum <josh@joshknows.com> | 2011-02-21 19:03:13 -0800 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-02-21 19:03:13 -0800 |
commit | a8bb5ec900d8f2d3d2f274a921d19b564c668323 (patch) | |
tree | a3f87f539a8ff641cd6580c0ea28d38adcd0b057 /host/lib/transport/if_addrs.cpp | |
parent | a7f9529f77700309dbaaa6250f6bd775bab7a70d (diff) | |
download | uhd-a8bb5ec900d8f2d3d2f274a921d19b564c668323.tar.gz uhd-a8bb5ec900d8f2d3d2f274a921d19b564c668323.tar.bz2 uhd-a8bb5ec900d8f2d3d2f274a921d19b564c668323.zip |
uhd: replace header checks in cmake files with more robust compile checks for features
implemented different ifdefs in the cpp files
Diffstat (limited to 'host/lib/transport/if_addrs.cpp')
-rw-r--r-- | host/lib/transport/if_addrs.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/host/lib/transport/if_addrs.cpp b/host/lib/transport/if_addrs.cpp index 17cf8455b..b7c8ad844 100644 --- a/host/lib/transport/if_addrs.cpp +++ b/host/lib/transport/if_addrs.cpp @@ -20,14 +20,10 @@ #include <boost/cstdint.hpp> #include <iostream> -uhd::transport::if_addrs_t::if_addrs_t(void){ - /* NOP */ -} - /*********************************************************************** * Interface address discovery through ifaddrs api **********************************************************************/ -#if defined(HAVE_IFADDRS_H) +#ifdef HAVE_GETIFADDRS #include <ifaddrs.h> static boost::asio::ip::address_v4 sockaddr_to_ip_addr(sockaddr *addr){ @@ -59,10 +55,12 @@ std::vector<uhd::transport::if_addrs_t> uhd::transport::get_if_addrs(void){ return if_addrs; } +#endif /* HAVE_GETIFADDRS */ + /*********************************************************************** * Interface address discovery through windows api **********************************************************************/ -#elif defined(HAVE_WINSOCK2_H) +#ifdef HAVE_SIO_GET_INTERFACE_LIST #include <winsock2.h> std::vector<uhd::transport::if_addrs_t> uhd::transport::get_if_addrs(void){ @@ -98,13 +96,15 @@ std::vector<uhd::transport::if_addrs_t> uhd::transport::get_if_addrs(void){ return if_addrs; } +#endif /* HAVE_SIO_GET_INTERFACE_LIST */ + /*********************************************************************** * Interface address discovery not included **********************************************************************/ -#else /* HAVE_IFADDRS_H */ +#ifdef HAVE_IF_ADDRS_DUMMY std::vector<uhd::transport::if_addrs_t> uhd::transport::get_if_addrs(void){ return std::vector<if_addrs_t>(); } -#endif /* HAVE_IFADDRS_H */ +#endif /* HAVE_IF_ADDRS_DUMMY */ |