mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-03-09 04:58:16 +03:00
build: Remove socklen_t checks
socklen_t has been mandated by POSIX for ages. Always use "socklen_t" or "int" on Win32.
This commit is contained in:
parent
b01b55d50e
commit
02326d72d3
@ -153,30 +153,6 @@ if (NOT MSVC)
|
||||
check_include_files(sys/timeb.h HAVE_SYS_TIMEB_H)
|
||||
check_include_files(sys/time.h HAVE_SYS_TIME_H)
|
||||
check_include_files(unistd.h HAVE_UNISTD_H)
|
||||
check_c_source_compiles("
|
||||
#include <stddef.h>
|
||||
#include <sys/socket.h>
|
||||
int main() { (void) getsockopt(1, 1, 1, NULL, (socklen_t*) NULL); return 0; }
|
||||
" XML_SOCKLEN_T_SOCKLEN_T)
|
||||
if(XML_SOCKLEN_T_SOCKLEN_T)
|
||||
set(XML_SOCKLEN_T socklen_t)
|
||||
else()
|
||||
check_c_source_compiles("
|
||||
#include <stddef.h>
|
||||
#include <sys/socket.h>
|
||||
int main() { (void) getsockopt(1, 1, 1, NULL, (size_t*) NULL); return 0; }
|
||||
" XML_SOCKLEN_T_SIZE_T)
|
||||
if(XML_SOCKLEN_T_SIZE_T)
|
||||
set(XML_SOCKLEN_T size_t)
|
||||
else()
|
||||
check_c_source_compiles("
|
||||
#include <stddef.h>
|
||||
#include <sys/socket.h>
|
||||
int main() { (void) getsockopt (1, 1, 1, NULL, (int*) NULL); return 0; }
|
||||
" XML_SOCKLEN_T_INT)
|
||||
set(XML_SOCKLEN_T int)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(LIBXML2_WITH_TLS)
|
||||
|
@ -99,8 +99,5 @@
|
||||
/* Version number of package */
|
||||
#cmakedefine VERSION "@VERSION@"
|
||||
|
||||
/* Determine what socket length (socklen_t) data type is */
|
||||
#cmakedefine XML_SOCKLEN_T @XML_SOCKLEN_T@
|
||||
|
||||
/* TLS specifier */
|
||||
#cmakedefine XML_THREAD_LOCAL @XML_THREAD_LOCAL@
|
||||
|
28
configure.ac
28
configure.ac
@ -328,34 +328,6 @@ if test "$with_http" = "yes"; then
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl Determine what socket length (socklen_t) data type is
|
||||
AC_MSG_CHECKING([for type of socket length (socklen_t)])
|
||||
AC_TRY_COMPILE2([
|
||||
#include <stddef.h>
|
||||
#ifdef _WIN32
|
||||
#include <ws2tcpip.h>
|
||||
#else
|
||||
#include <sys/socket.h>
|
||||
#endif],[
|
||||
(void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[
|
||||
AC_MSG_RESULT(socklen_t *)
|
||||
XML_SOCKLEN_T=socklen_t],[
|
||||
AC_TRY_COMPILE2([
|
||||
#include <stddef.h>
|
||||
#include <sys/socket.h>],[
|
||||
(void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)],[
|
||||
AC_MSG_RESULT(size_t *)
|
||||
XML_SOCKLEN_T=size_t],[
|
||||
AC_TRY_COMPILE2([
|
||||
#include <stddef.h>
|
||||
#include <sys/socket.h>],[
|
||||
(void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[
|
||||
AC_MSG_RESULT(int *)
|
||||
XML_SOCKLEN_T=int],[
|
||||
AC_MSG_WARN(could not determine)
|
||||
XML_SOCKLEN_T="int"])])])
|
||||
AC_DEFINE_UNQUOTED(XML_SOCKLEN_T, $XML_SOCKLEN_T, [Determine what socket length (socklen_t) data type is])
|
||||
|
||||
dnl
|
||||
dnl Checking for availability of IPv6
|
||||
dnl
|
||||
|
@ -30,10 +30,6 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef XML_SOCKLEN_T
|
||||
#define XML_SOCKLEN_T int
|
||||
#endif
|
||||
|
||||
#ifndef ECONNRESET
|
||||
#define ECONNRESET WSAECONNRESET
|
||||
#endif
|
||||
|
@ -382,18 +382,11 @@ if want_http == true
|
||||
endif
|
||||
endif
|
||||
|
||||
### socket length
|
||||
if sys_windows
|
||||
netheader = 'winsock2.h'
|
||||
else
|
||||
netheader = 'sys/socket.h'
|
||||
endif
|
||||
foreach t : ['socklen_t', 'size_t', 'int']
|
||||
if cc.compiles('#include <@0@.h> int main(){getsockopt(1,1,1,0,(@1@*)0);}'.format(netheader, t), dependencies: net_dep)
|
||||
cdata.set('XML_SOCKLEN_T', t)
|
||||
break
|
||||
endif
|
||||
endforeach
|
||||
|
||||
if want_ipv6 == true
|
||||
config_h.set('SUPPORT_IP6', cc.has_header_symbol(netheader, 'AF_INET6', required: get_option('ipv6')))
|
||||
|
18
nanohttp.c
18
nanohttp.c
@ -54,14 +54,14 @@
|
||||
#include <zlib.h>
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef VMS
|
||||
#include <stropts>
|
||||
#define XML_SOCKLEN_T unsigned int
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
#include <wsockcompat.h>
|
||||
#include <stropts>
|
||||
#define XML_SOCKLEN_T unsigned int
|
||||
#elif defined(_WIN32)
|
||||
#include <wsockcompat.h>
|
||||
#define XML_SOCKLEN_T int
|
||||
#else
|
||||
#define XML_SOCKLEN_T socklen_t
|
||||
#endif
|
||||
|
||||
#include <libxml/xmlerror.h>
|
||||
@ -82,10 +82,6 @@
|
||||
#define INVALID_SOCKET (-1)
|
||||
#endif
|
||||
|
||||
#ifndef XML_SOCKLEN_T
|
||||
#define XML_SOCKLEN_T unsigned int
|
||||
#endif
|
||||
|
||||
#define GETHOSTBYNAME_ARG_CAST (char *)
|
||||
#define SEND_ARG2_CAST (char *)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user