updated the default definition of moo_sa_family_t
This commit is contained in:
parent
d3a57db467
commit
9a49b4fa53
@ -189,6 +189,48 @@ LIBS="$save_LIBS"
|
|||||||
AC_SUBST(TERMINAL_LIBS)
|
AC_SUBST(TERMINAL_LIBS)
|
||||||
|
|
||||||
|
|
||||||
|
dnl OLDLIBS="$LIBS"
|
||||||
|
dnl AC_SEARCH_LIBS([connect], [socket])
|
||||||
|
dnl LIBS="$OLDLIBS"
|
||||||
|
dnl if test "$ac_cv_search_connect" != "none required" -a "$ac_cv_search_connect" != "no"
|
||||||
|
dnl then
|
||||||
|
dnl SOCKET_LIBS="$SOCKET_LIBS -lsocket"
|
||||||
|
dnl fi
|
||||||
|
dnl AC_SUBST(SOCKET_LIBS)
|
||||||
|
AC_CHECK_FUNCS([connect gethostbyname])
|
||||||
|
if test "x$ac_cv_func_gethostbyname" = "xno"
|
||||||
|
then
|
||||||
|
AC_CHECK_LIB([nsl], [gethostbyname], [
|
||||||
|
SOCKET_LIBS="$SOCKET_LIBS -lnsl"
|
||||||
|
AC_DEFINE(HAVE_GETHOSTBYNAME, 1)
|
||||||
|
])
|
||||||
|
fi
|
||||||
|
if test "x$ac_cv_func_connect" = "xno"
|
||||||
|
then
|
||||||
|
AC_CHECK_LIB([socket], [connect], [
|
||||||
|
SOCKET_LIBS="$SOCKET_LIBS -lsocket"
|
||||||
|
AC_DEFINE(HAVE_CONNECT, 1)
|
||||||
|
])
|
||||||
|
|
||||||
|
if test "x$ac_cv_lib_socket_connect" = xno
|
||||||
|
then
|
||||||
|
AC_CHECK_FUNCS([t_connect])
|
||||||
|
if test "x$ac_cv_func_t_connect" = "xno"
|
||||||
|
then
|
||||||
|
AC_CHECK_LIB([nsl_s], [t_connect], [
|
||||||
|
SOCKET_LIBS="$SOCKET_LIBS -lnsl_s"
|
||||||
|
AC_DEFINE(HAVE_T_CONNECT, 1)
|
||||||
|
])
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if test "x${platform_win32}" = "xyes"
|
||||||
|
then
|
||||||
|
SOCKET_LIBS="$SOCKET_LIBS -lws2_32"
|
||||||
|
fi
|
||||||
|
AC_SUBST(SOCKET_LIBS)
|
||||||
|
|
||||||
|
|
||||||
dnl check is the import library for unicows.dll exists
|
dnl check is the import library for unicows.dll exists
|
||||||
dnl this check doesn't look for a particular symbol
|
dnl this check doesn't look for a particular symbol
|
||||||
dnl but for the symbol 'main' since i want to check
|
dnl but for the symbol 'main' since i want to check
|
||||||
|
@ -505,7 +505,7 @@ error -> exception
|
|||||||
[
|
[
|
||||||
s := Socket domain: Socket.Domain.INET type: Socket.Type.STREAM.
|
s := Socket domain: Socket.Domain.INET type: Socket.Type.STREAM.
|
||||||
s inputAction: inact; outputAction: outact.
|
s inputAction: inact; outputAction: outact.
|
||||||
s connectTo: (SocketAddress fromString: '127.0.0.1:9999') do: conact.
|
s connectTo: (SocketAddress fromString: '192.168.1.108:9999') do: conact.
|
||||||
|
|
||||||
s2 := Socket domain: Socket.Domain.INET type: Socket.Type.STREAM.
|
s2 := Socket domain: Socket.Domain.INET type: Socket.Type.STREAM.
|
||||||
s2 inputAction: accact.
|
s2 inputAction: accact.
|
||||||
|
@ -103,9 +103,9 @@ struct sck_t
|
|||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
# undef MOO_SIZEOF_SA_FAMILY_T
|
# undef MOO_SIZEOF_SA_FAMILY_T
|
||||||
# define MOO_SIZEOF_SA_FAMILY_T MOO_SIZEOF_INT
|
# define MOO_SIZEOF_SA_FAMILY_T MOO_SIZEOF_SHORT
|
||||||
# define MOO_SA_FAMILY_T_IS_SIGNED
|
# undef MOO_SA_FAMILY_T_IS_SIGNED
|
||||||
typedef int sck_addr_family_t;
|
typedef unsigned short int sck_addr_family_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct sck_addr_t
|
struct sck_addr_t
|
||||||
|
@ -63,6 +63,7 @@ static moo_pfrc_t pf_open_socket (moo_t* moo, moo_ooi_t nargs)
|
|||||||
typev |= SOCK_NONBLOCK | SOCK_CLOEXEC;
|
typev |= SOCK_NONBLOCK | SOCK_CLOEXEC;
|
||||||
create_socket:
|
create_socket:
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
fd = socket (MOO_OOP_TO_SMOOI(dom), typev, MOO_OOP_TO_SMOOI(proto));
|
fd = socket (MOO_OOP_TO_SMOOI(dom), typev, MOO_OOP_TO_SMOOI(proto));
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user