mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-14 07:30:32 +02:00
Changes to compile under gnu-win32, from Marcus Daniels:
* stime.c (tzset): If tzset isn't provided, make it a NOP. (scm_localtime): Change SCM_EOF to SCM_EOL. (scm_mktime): Likewise. * socket.c: Don't include sys/un.h unless autoconf tells us Unix domain sockets are available. (scm_fill_sockaddr): Ignore Unix domain code. (scm_addr_vector): Likewise. (scm_init_addr_buffer): Likewise. (scm_socketpair): Don't include unless socketpair was found during autoconf. * simpos.c (SYSTNAME): Treat cygwin like Unix. * scmsigs.c (scm_pause): Don't include unless pause was found during autoconf. * posix.c (scm_getgroups): Don't include unless support function was found during autoconf (in this case, getgroups). (scm_setpwent): For setpwent. (scm_setegid): For setegid. * net_db.c (scm_inet_netof): Don't include unless support function was found during autoconf (in this case, inet_netof). (scm_lnaof): For inet_lnaof. (scm_inet_makeaddr): For inet_makeaddr. (scm_getnet): For getnetent, getnetbyname, getnetbyaddr. (scm_getproto): For getprotoent. (scm_getserv): For getservent. (scm_sethost): For sethostent, endhostent. (scm_setnet): For setnetent, endnetent. (scm_setproto): For setprotoent, endprotoent. (scm_setserv): For setservent, endservent. * scmconfig.h.in: Regenerated.
This commit is contained in:
parent
4cd2a3e684
commit
0e95879552
7 changed files with 71 additions and 9 deletions
|
@ -57,7 +57,9 @@
|
|||
#endif
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#ifdef UNIX_DOMAIN_SOCKETS
|
||||
#include <sys/un.h>
|
||||
#endif
|
||||
#include <netinet/in.h>
|
||||
#include <netdb.h>
|
||||
#include <arpa/inet.h>
|
||||
|
@ -117,6 +119,7 @@ scm_socket (family, style, proto)
|
|||
|
||||
|
||||
|
||||
#ifdef HAVE_SOCKETPAIR
|
||||
SCM_PROC (s_socketpair, "socketpair", 3, 0, 0, scm_socketpair);
|
||||
|
||||
SCM
|
||||
|
@ -145,7 +148,7 @@ scm_socketpair (family, style, proto)
|
|||
SCM_ALLOW_INTS;
|
||||
return scm_cons (a, b);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
SCM_PROC (s_getsockopt, "getsockopt", 3, 0, 0, scm_getsockopt);
|
||||
|
||||
|
@ -349,6 +352,7 @@ scm_fill_sockaddr (fam, address, args, which_arg, proc, size)
|
|||
*size = sizeof (struct sockaddr_in);
|
||||
return (struct sockaddr *) soka;
|
||||
}
|
||||
#ifdef UNIX_DOMAIN_SOCKETS
|
||||
case AF_UNIX:
|
||||
{
|
||||
struct sockaddr_un *soka;
|
||||
|
@ -363,6 +367,7 @@ scm_fill_sockaddr (fam, address, args, which_arg, proc, size)
|
|||
*size = sizeof (struct sockaddr_un);
|
||||
return (struct sockaddr *) soka;
|
||||
}
|
||||
#endif
|
||||
default:
|
||||
scm_out_of_range (proc, SCM_MAKINUM (fam));
|
||||
}
|
||||
|
@ -446,6 +451,7 @@ scm_addr_vector (address, proc)
|
|||
short int fam = address->sa_family;
|
||||
SCM result;
|
||||
SCM *ve;
|
||||
#ifdef UNIX_DOMAIN_SOCKETS
|
||||
if (fam == AF_UNIX)
|
||||
{
|
||||
struct sockaddr_un *nad = (struct sockaddr_un *) address;
|
||||
|
@ -455,7 +461,9 @@ scm_addr_vector (address, proc)
|
|||
ve[1] = scm_makfromstr (nad->sun_path,
|
||||
(scm_sizet) strlen (nad->sun_path), 0);
|
||||
}
|
||||
else if (fam == AF_INET)
|
||||
else
|
||||
#endif
|
||||
if (fam == AF_INET)
|
||||
{
|
||||
struct sockaddr_in *nad = (struct sockaddr_in *) address;
|
||||
result = scm_make_vector (SCM_MAKINUM (3), SCM_UNSPECIFIED, SCM_BOOL_F);
|
||||
|
@ -480,7 +488,13 @@ static void scm_init_addr_buffer SCM_P ((void));
|
|||
static void
|
||||
scm_init_addr_buffer ()
|
||||
{
|
||||
scm_addr_buffer_size = (int) sizeof (struct sockaddr_un);
|
||||
scm_addr_buffer_size =
|
||||
#ifdef UNIX_DOMAIN_SOCKETS
|
||||
(int) sizeof (struct sockaddr_un)
|
||||
#else
|
||||
0
|
||||
#endif
|
||||
;
|
||||
if (sizeof (struct sockaddr_in) > scm_addr_buffer_size)
|
||||
scm_addr_buffer_size = (int) sizeof (struct sockaddr_in);
|
||||
scm_addr_buffer = scm_must_malloc (scm_addr_buffer_size, "address buffer");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue