1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-21 20:20:24 +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:
Jim Blandy 1997-07-11 05:43:36 +00:00
parent 4cd2a3e684
commit 0e95879552
7 changed files with 71 additions and 9 deletions

View file

@ -109,6 +109,7 @@ scm_inet_ntoa (inetid)
return answer;
}
#ifdef HAVE_INET_NETOF
SCM_PROC (s_inet_netof, "inet-netof", 1, 0, 0, scm_inet_netof);
SCM
@ -119,7 +120,9 @@ scm_inet_netof (address)
addr.s_addr = htonl (scm_num2ulong (address, (char *) SCM_ARG1, s_inet_netof));
return scm_ulong2num ((unsigned long) inet_netof (addr));
}
#endif
#ifdef HAVE_INET_LNAOF
SCM_PROC (s_lnaof, "inet-lnaof", 1, 0, 0, scm_lnaof);
SCM
@ -130,8 +133,9 @@ scm_lnaof (address)
addr.s_addr = htonl (scm_num2ulong (address, (char *) SCM_ARG1, s_lnaof));
return scm_ulong2num ((unsigned long) inet_lnaof (addr));
}
#endif
#ifdef HAVE_INET_MAKEADDR
SCM_PROC (s_inet_makeaddr, "inet-makeaddr", 2, 0, 0, scm_inet_makeaddr);
SCM
@ -148,6 +152,7 @@ scm_inet_makeaddr (net, lna)
addr = inet_makeaddr (netnum, lnanum);
return scm_ulong2num (ntohl (addr.s_addr));
}
#endif
/* !!! Doesn't take address format.
@ -244,6 +249,7 @@ scm_gethost (name)
doesn't seem quite right (what if errno gets set as part of healthy
operation?), but it seems to work okay. We'll see. */
#if defined(HAVE_GETNETENT) && defined(HAVE_GETNETBYNAME) && defined(HAVE_GETNETBYADDR)
SCM_PROC (s_getnet, "getnet", 0, 1, 0, scm_getnet);
SCM
@ -293,7 +299,9 @@ scm_getnet (name)
ve[3] = scm_ulong2num (entry->n_net + 0L);
return ans;
}
#endif
#ifdef HAVE_GETPROTOENT
SCM_PROC (s_getproto, "getproto", 0, 1, 0, scm_getproto);
SCM
@ -342,7 +350,7 @@ scm_getproto (name)
ve[2] = SCM_MAKINUM (entry->p_proto + 0L);
return ans;
}
#endif
static SCM scm_return_entry SCM_P ((struct servent *entry));
@ -363,6 +371,7 @@ scm_return_entry (entry)
return ans;
}
#ifdef HAVE_GETSERVENT
SCM_PROC (s_getserv, "getserv", 0, 2, 0, scm_getserv);
SCM
@ -406,7 +415,9 @@ scm_getserv (name, proto)
SCM_ALLOW_INTS;
return scm_return_entry (entry);
}
#endif
#if defined(HAVE_SETHOSTENT) && defined(HAVE_ENDHOSTENT)
SCM_PROC (s_sethost, "sethost", 0, 1, 0, scm_sethost);
SCM
@ -419,7 +430,9 @@ scm_sethost (arg)
sethostent (SCM_NFALSEP (arg));
return SCM_UNSPECIFIED;
}
#endif
#if defined(HAVE_SETNETENT) && defined(HAVE_ENDNETENT)
SCM_PROC (s_setnet, "setnet", 0, 1, 0, scm_setnet);
SCM
@ -432,7 +445,9 @@ scm_setnet (arg)
setnetent (SCM_NFALSEP (arg));
return SCM_UNSPECIFIED;
}
#endif
#if defined(HAVE_SETPROTOENT) && defined(HAVE_ENDPROTOENT)
SCM_PROC (s_setproto, "setproto", 0, 1, 0, scm_setproto);
SCM
@ -445,7 +460,9 @@ scm_setproto (arg)
setprotoent (SCM_NFALSEP (arg));
return SCM_UNSPECIFIED;
}
#endif
#if defined(HAVE_SETSERVENT) && defined(HAVE_ENDSERVENT)
SCM_PROC (s_setserv, "setserv", 0, 1, 0, scm_setserv);
SCM
@ -458,6 +475,7 @@ scm_setserv (arg)
setservent (SCM_NFALSEP (arg));
return SCM_UNSPECIFIED;
}
#endif
void

View file

@ -207,7 +207,7 @@ scm_pipe ()
}
#ifdef HAVE_GETGROUPS
SCM_PROC (s_getgroups, "getgroups", 0, 0, 0, scm_getgroups);
SCM
@ -240,7 +240,7 @@ scm_getgroups()
return ans;
}
}
#endif
SCM_PROC (s_getpwuid, "getpw", 0, 1, 0, scm_getpwuid);
@ -299,7 +299,7 @@ scm_getpwuid (user)
}
#ifdef HAVE_SETPWENT
SCM_PROC (s_setpwent, "setpw", 0, 1, 0, scm_setpwent);
SCM
@ -312,6 +312,7 @@ scm_setpwent (arg)
setpwent ();
return SCM_UNSPECIFIED;
}
#endif
@ -572,6 +573,7 @@ scm_seteuid (id)
return SCM_UNSPECIFIED;
}
#ifdef HAVE_SETEGID
SCM_PROC (s_setegid, "setegid", 1, 0, 0, scm_setegid);
SCM
@ -591,6 +593,7 @@ scm_setegid (id)
return SCM_UNSPECIFIED;
}
#endif
SCM_PROC (s_getpgrp, "getpgrp", 0, 0, 0, scm_getpgrp);
SCM

View file

@ -155,6 +155,9 @@
/* Define if the operating system can restart system calls. */
#undef HAVE_RESTARTS
/* Define if the system supports Unix-domain (file-domain) sockets. */
#undef HAVE_UNIX_DOMAIN_SOCKETS
/* Define if you have the ctermid function. */
#undef HAVE_CTERMID
@ -167,6 +170,9 @@
/* Define if you have the geteuid function. */
#undef HAVE_GETEUID
/* Define if you have the getgroups function. */
#undef HAVE_GETGROUPS
/* Define if you have the gethostent function. */
#undef HAVE_GETHOSTENT
@ -188,6 +194,9 @@
/* Define if you have the nice function. */
#undef HAVE_NICE
/* Define if you have the pause function. */
#undef HAVE_PAUSE
/* Define if you have the putenv function. */
#undef HAVE_PUTENV
@ -218,6 +227,9 @@
/* Define if you have the setpgid function. */
#undef HAVE_SETPGID
/* Define if you have the setpwent function. */
#undef HAVE_SETPWENT
/* Define if you have the setsid function. */
#undef HAVE_SETSID
@ -227,6 +239,9 @@
/* Define if you have the sigaction function. */
#undef HAVE_SIGACTION
/* Define if you have the socketpair function. */
#undef HAVE_SOCKETPAIR
/* Define if you have the strerror function. */
#undef HAVE_STRERROR
@ -251,6 +266,9 @@
/* Define if you have the times function. */
#undef HAVE_TIMES
/* Define if you have the tzset function. */
#undef HAVE_TZSET
/* Define if you have the uname function. */
#undef HAVE_UNAME
@ -275,6 +293,9 @@
/* Define if you have the <ndir.h> header file. */
#undef HAVE_NDIR_H
/* Define if you have the <regex.h> header file. */
#undef HAVE_REGEX_H
/* Define if you have the <string.h> header file. */
#undef HAVE_STRING_H

View file

@ -329,6 +329,7 @@ scm_alarm (i)
return SCM_MAKINUM (j);
}
#ifdef HAVE_PAUSE
SCM_PROC(s_pause, "pause", 0, 0, 0, scm_pause);
SCM
@ -337,6 +338,7 @@ scm_pause ()
pause ();
return SCM_UNSPECIFIED;
}
#endif
SCM_PROC(s_sleep, "sleep", 1, 0, 0, scm_sleep);

View file

@ -117,7 +117,7 @@ scm_primitive_exit (SCM status)
#ifdef vms
# define SYSTNAME "VMS"
#endif
#if defined (unix) || defined (__unix)
#if defined (unix) || defined (__unix) || defined(__CYGWIN32__)
# define SYSTNAME "UNIX"
#endif
#ifdef MWC

View file

@ -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");

View file

@ -160,6 +160,10 @@ scm_get_internal_real_time()
}
#endif
#ifndef HAVE_TZSET
/* GNU-WIN32's cygwin.dll doesn't have this. */
#define tzset()
#endif
static long scm_my_base = 0;