Added some socket functions

This commit is contained in:
2018-01-25 09:56:30 +00:00
parent c0a072a054
commit 47f662861f
9 changed files with 337 additions and 32 deletions

168
qse/configure vendored
View File

@ -22246,6 +22246,84 @@ $as_echo "$ac_res" >&6; }
$as_echo "#define QSE_SOCKLEN_T_IS_SIGNED 1" >>confdefs.h
elif eval "test \"\${ax_cv_decl_${typename}_signed}\" = \"no\""; then
$as_echo_n ""
fi
fi
# The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of sa_family_t" >&5
$as_echo_n "checking size of sa_family_t... " >&6; }
if ${ac_cv_sizeof_sa_family_t+:} false; then :
$as_echo_n "(cached) " >&6
else
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (sa_family_t))" "ac_cv_sizeof_sa_family_t" "
#include <winsock2.h>
#include <ws2tcpip.h>
"; then :
else
if test "$ac_cv_type_sa_family_t" = yes; then
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "cannot compute sizeof (sa_family_t)
See \`config.log' for more details" "$LINENO" 5; }
else
ac_cv_sizeof_sa_family_t=0
fi
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_sa_family_t" >&5
$as_echo "$ac_cv_sizeof_sa_family_t" >&6; }
cat >>confdefs.h <<_ACEOF
#define SIZEOF_SA_FAMILY_T $ac_cv_sizeof_sa_family_t
_ACEOF
if test ${ac_cv_sizeof_sa_family_t} -gt 0
then
typename=`echo sa_family_t | sed "s/[^a-zA-Z0-9_]/_/g"`
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sa_family_t is signed" >&5
$as_echo_n "checking whether sa_family_t is signed... " >&6; }
if eval \${ax_cv_decl_${typename}_signed+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <winsock2.h>
#include <ws2tcpip.h>
int
main ()
{
int foo [ 1 - 2 * !(((sa_family_t) -1) < 0) ]
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
eval "ax_cv_decl_${typename}_signed=\"yes\""
else
eval "ax_cv_decl_${typename}_signed=\"no\""
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
eval ac_res=\$ax_cv_decl_${typename}_signed
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
symbolname=`echo sa_family_t | sed "s/[^a-zA-Z0-9_]/_/g" | tr "a-z" "A-Z"`
if eval "test \"\${ax_cv_decl_${typename}_signed}\" = \"yes\""; then
$as_echo "#define QSE_SA_FAMILY_T_IS_SIGNED 1" >>confdefs.h
elif eval "test \"\${ax_cv_decl_${typename}_signed}\" = \"no\""; then
$as_echo_n ""
fi
@ -22262,6 +22340,7 @@ if ${ac_cv_sizeof_struct_sockaddr_in+:} false; then :
$as_echo_n "(cached) " >&6
else
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (struct sockaddr_in))" "ac_cv_sizeof_struct_sockaddr_in" "
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
"; then :
@ -22298,6 +22377,7 @@ if ${ac_cv_sizeof_struct_sockaddr_in6+:} false; then :
$as_echo_n "(cached) " >&6
else
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (struct sockaddr_in6))" "ac_cv_sizeof_struct_sockaddr_in6" "
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
"; then :
@ -22334,6 +22414,7 @@ if ${ac_cv_sizeof_struct_sockaddr_un+:} false; then :
$as_echo_n "(cached) " >&6
else
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (struct sockaddr_un))" "ac_cv_sizeof_struct_sockaddr_un" "
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
"; then :
@ -22370,6 +22451,7 @@ if ${ac_cv_sizeof_struct_sockaddr_ll+:} false; then :
$as_echo_n "(cached) " >&6
else
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (struct sockaddr_ll))" "ac_cv_sizeof_struct_sockaddr_ll" "
#include <sys/types.h>
#include <sys/socket.h>
#include <netpacket/packet.h>
"; then :
@ -22406,8 +22488,8 @@ if ${ac_cv_sizeof_struct_sockaddr_dl+:} false; then :
$as_echo_n "(cached) " >&6
else
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (struct sockaddr_dl))" "ac_cv_sizeof_struct_sockaddr_dl" "
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <net/if_dl.h>
"; then :
@ -22433,6 +22515,7 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
# The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
@ -22443,6 +22526,7 @@ if ${ac_cv_sizeof_socklen_t+:} false; then :
$as_echo_n "(cached) " >&6
else
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (socklen_t))" "ac_cv_sizeof_socklen_t" "
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
"; then :
@ -22469,7 +22553,6 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
if test ${ac_cv_sizeof_socklen_t} -gt 0
then
@ -22511,6 +22594,87 @@ $as_echo "#define QSE_SOCKLEN_T_IS_SIGNED 1" >>confdefs.h
fi
fi
# The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of sa_family_t" >&5
$as_echo_n "checking size of sa_family_t... " >&6; }
if ${ac_cv_sizeof_sa_family_t+:} false; then :
$as_echo_n "(cached) " >&6
else
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (sa_family_t))" "ac_cv_sizeof_sa_family_t" "
#include <sys/socket.h>
#include <netinet/in.h>
"; then :
else
if test "$ac_cv_type_sa_family_t" = yes; then
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "cannot compute sizeof (sa_family_t)
See \`config.log' for more details" "$LINENO" 5; }
else
ac_cv_sizeof_sa_family_t=0
fi
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_sa_family_t" >&5
$as_echo "$ac_cv_sizeof_sa_family_t" >&6; }
cat >>confdefs.h <<_ACEOF
#define SIZEOF_SA_FAMILY_T $ac_cv_sizeof_sa_family_t
_ACEOF
if test ${ac_cv_sizeof_sa_family_t} -gt 0
then
typename=`echo sa_family_t | sed "s/[^a-zA-Z0-9_]/_/g"`
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sa_family_t is signed" >&5
$as_echo_n "checking whether sa_family_t is signed... " >&6; }
if eval \${ax_cv_decl_${typename}_signed+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
int
main ()
{
int foo [ 1 - 2 * !(((sa_family_t) -1) < 0) ]
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
eval "ax_cv_decl_${typename}_signed=\"yes\""
else
eval "ax_cv_decl_${typename}_signed=\"no\""
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
eval ac_res=\$ax_cv_decl_${typename}_signed
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
symbolname=`echo sa_family_t | sed "s/[^a-zA-Z0-9_]/_/g" | tr "a-z" "A-Z"`
if eval "test \"\${ax_cv_decl_${typename}_signed}\" = \"yes\""; then
$as_echo "#define QSE_SA_FAMILY_T_IS_SIGNED 1" >>confdefs.h
elif eval "test \"\${ax_cv_decl_${typename}_signed}\" = \"no\""; then
$as_echo_n ""
fi
fi
fi