2019-03-11 Jonathan Wakely <jwakely@redhat.com>
+ PR libstdc++/89460
+ * configure.ac: Check for sockatmark.
+ * crossconfig.m4: Check for sockatmark.
+ * config.h.in: Regenerate.
+ * configure: Regenerate.
+ * include/experimental/internet (address_v4::_S_hton): Rename
+ overloaded functions to _S_hton_16 and _S_ntoh_16.
+ (address_v4::_S_ntoh): Rename to _S_ntoh_16 and _S_ntoh_32.
+ (basic_endpoint): Adjust calls to _S_hton and _S_ntoh.
+ * include/experimental/socket (basic_socket::at_mark): Check
+ _GLIBCXX_HAVE_SOCKATMARK.
+
* testsuite/29_atomics/atomic_flag/test_and_set/explicit-hle.cc: Use
const variables instead of macros.
#define HAVE_TIMESPEC_GET 1
_ACEOF
+fi
+done
+
+
+ # For Networking TS.
+ for ac_func in sockatmark
+do :
+ ac_fn_c_check_func "$LINENO" "sockatmark" "ac_cv_func_sockatmark"
+if test "x$ac_cv_func_sockatmark" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SOCKATMARK 1
+_ACEOF
+
fi
done
#define HAVE_TIMESPEC_GET 1
_ACEOF
+fi
+done
+
+ for ac_func in sockatmark
+do :
+ ac_fn_c_check_func "$LINENO" "sockatmark" "ac_cv_func_sockatmark"
+if test "x$ac_cv_func_sockatmark" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SOCKATMARK 1
+_ACEOF
+
fi
done
fi
done
+ for ac_func in sockatmark
+do :
+ ac_fn_c_check_func "$LINENO" "sockatmark" "ac_cv_func_sockatmark"
+if test "x$ac_cv_func_sockatmark" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SOCKATMARK 1
+_ACEOF
+
+fi
+done
+
#define HAVE_TIMESPEC_GET 1
_ACEOF
+fi
+done
+
+ for ac_func in sockatmark
+do :
+ ac_fn_c_check_func "$LINENO" "sockatmark" "ac_cv_func_sockatmark"
+if test "x$ac_cv_func_sockatmark" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SOCKATMARK 1
+_ACEOF
+
fi
done
AC_CHECK_FUNCS(__cxa_thread_atexit)
AC_CHECK_FUNCS(aligned_alloc posix_memalign memalign _aligned_malloc)
AC_CHECK_FUNCS(timespec_get)
+ AC_CHECK_FUNCS(sockatmark)
;;
*-fuchsia*)
AC_CHECK_FUNCS(__cxa_thread_atexit_impl)
AC_CHECK_FUNCS(aligned_alloc posix_memalign memalign _aligned_malloc)
AC_CHECK_FUNCS(timespec_get)
+ AC_CHECK_FUNCS(sockatmark)
AM_ICONV
;;
*-mingw32*)
fi
AC_CHECK_FUNCS(aligned_alloc posix_memalign memalign _aligned_malloc)
AC_CHECK_FUNCS(timespec_get)
+ AC_CHECK_FUNCS(sockatmark)
;;
*-qnx6.1* | *-qnx6.2*)
SECTION_FLAGS='-ffunction-sections -fdata-sections'
{ }
explicit constexpr
- address_v4(uint_type __val) : _M_addr(_S_hton(__val))
+ address_v4(uint_type __val) : _M_addr(_S_hton_32(__val))
{
#if UINT_LEAST32_MAX > 0xFFFFFFFF
if (__val > 0xFFFFFFFF)
};
}
- constexpr uint_type to_uint() const noexcept { return _S_ntoh(_M_addr); }
+ constexpr uint_type
+ to_uint() const noexcept { return _S_ntoh_32(_M_addr); }
#ifdef _GLIBCXX_HAVE_ARPA_INET_H
template<typename _Allocator = allocator<char>>
friend address_v4 make_address_v4(const char*, error_code&) noexcept;
#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
- static constexpr uint16_t _S_hton(uint16_t __h) { return __h; }
- static constexpr uint16_t _S_ntoh(uint16_t __n) { return __n; }
- static constexpr uint32_t _S_hton(uint32_t __h) { return __h; }
- static constexpr uint32_t _S_ntoh(uint32_t __n) { return __n; }
+ static constexpr uint16_t _S_hton_16(uint16_t __h) { return __h; }
+ static constexpr uint16_t _S_ntoh_16(uint16_t __n) { return __n; }
+ static constexpr uint32_t _S_hton_32(uint32_t __h) { return __h; }
+ static constexpr uint32_t _S_ntoh_32(uint32_t __n) { return __n; }
#else
static constexpr uint16_t
- _S_hton(uint16_t __h) { return __builtin_bswap16(__h); }
+ _S_hton_16(uint16_t __h) { return __builtin_bswap16(__h); }
static constexpr uint16_t
- _S_ntoh(uint16_t __n) { return __builtin_bswap16(__n); }
+ _S_ntoh_16(uint16_t __n) { return __builtin_bswap16(__n); }
static constexpr uint32_t
- _S_hton(uint32_t __h) { return __builtin_bswap32(__h); }
+ _S_hton_32(uint32_t __h) { return __builtin_bswap32(__h); }
static constexpr uint32_t
- _S_ntoh(uint32_t __n) { return __builtin_bswap32(__n); }
+ _S_ntoh_32(uint32_t __n) { return __builtin_bswap32(__n); }
#endif
in_addr_t _M_addr; // network byte order
|| __proto == protocol_type::v6());
_M_data._M_v4.sin_family = __proto.family();
- _M_data._M_v4.sin_port = address_v4::_S_hton(__port_num);
+ _M_data._M_v4.sin_port = address_v4::_S_hton_16(__port_num);
}
constexpr
if (__addr.is_v4())
{
_M_data._M_v4.sin_family = protocol_type::v4().family();
- _M_data._M_v4.sin_port = address_v4::_S_hton(__port_num);
+ _M_data._M_v4.sin_port = address_v4::_S_hton_16(__port_num);
_M_data._M_v4.sin_addr.s_addr = __addr._M_v4._M_addr;
}
else
{
_M_data._M_v6 = {};
_M_data._M_v6.sin6_family = protocol_type::v6().family();
- _M_data._M_v6.sin6_port = address_v4::_S_hton(__port_num);
+ _M_data._M_v6.sin6_port = address_v4::_S_hton_16(__port_num);
__builtin_memcpy(_M_data._M_v6.sin6_addr.s6_addr,
__addr._M_v6._M_bytes.data(), 16);
_M_data._M_v6.sin6_scope_id = __addr._M_v6._M_scope_id;
constexpr port_type
port() const noexcept
- { return address_v4::_S_ntoh(_M_data._M_v4.sin_port); }
+ { return address_v4::_S_ntoh_16(_M_data._M_v4.sin_port); }
void
port(port_type __port_num) noexcept
- { _M_data._M_v4.sin_port = address_v4::_S_hton(__port_num); }
+ { _M_data._M_v4.sin_port = address_v4::_S_hton_16(__port_num); }
void* data() noexcept { return &_M_data; }
const void* data() const noexcept { return &_M_data; }