diff options
author | Jim Blandy <jimb@red-bean.com> | 1997-06-24 01:45:30 +0000 |
---|---|---|
committer | Jim Blandy <jimb@red-bean.com> | 1997-06-24 01:45:30 +0000 |
commit | bb73cc183294b1a07306da0d3b6c038d98af0ee8 (patch) | |
tree | 503042e3a570f9b66602a2e47c8361946589aeb3 /libguile/socket.c | |
parent | eda764e9d4d69cd220cde9e0d2afaa67a854bc9d (diff) | |
download | guile-bb73cc183294b1a07306da0d3b6c038d98af0ee8.tar.gz |
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.
Diffstat (limited to 'libguile/socket.c')
-rw-r--r-- | libguile/socket.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/libguile/socket.c b/libguile/socket.c index 64eb02d42..935f31587 100644 --- a/libguile/socket.c +++ b/libguile/socket.c @@ -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"); |