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

View file

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

View file

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

View file

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

View file

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

View file

@ -57,7 +57,9 @@
#endif #endif
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
#ifdef UNIX_DOMAIN_SOCKETS
#include <sys/un.h> #include <sys/un.h>
#endif
#include <netinet/in.h> #include <netinet/in.h>
#include <netdb.h> #include <netdb.h>
#include <arpa/inet.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_PROC (s_socketpair, "socketpair", 3, 0, 0, scm_socketpair);
SCM SCM
@ -145,7 +148,7 @@ scm_socketpair (family, style, proto)
SCM_ALLOW_INTS; SCM_ALLOW_INTS;
return scm_cons (a, b); return scm_cons (a, b);
} }
#endif
SCM_PROC (s_getsockopt, "getsockopt", 3, 0, 0, scm_getsockopt); 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); *size = sizeof (struct sockaddr_in);
return (struct sockaddr *) soka; return (struct sockaddr *) soka;
} }
#ifdef UNIX_DOMAIN_SOCKETS
case AF_UNIX: case AF_UNIX:
{ {
struct sockaddr_un *soka; struct sockaddr_un *soka;
@ -363,6 +367,7 @@ scm_fill_sockaddr (fam, address, args, which_arg, proc, size)
*size = sizeof (struct sockaddr_un); *size = sizeof (struct sockaddr_un);
return (struct sockaddr *) soka; return (struct sockaddr *) soka;
} }
#endif
default: default:
scm_out_of_range (proc, SCM_MAKINUM (fam)); scm_out_of_range (proc, SCM_MAKINUM (fam));
} }
@ -446,6 +451,7 @@ scm_addr_vector (address, proc)
short int fam = address->sa_family; short int fam = address->sa_family;
SCM result; SCM result;
SCM *ve; SCM *ve;
#ifdef UNIX_DOMAIN_SOCKETS
if (fam == AF_UNIX) if (fam == AF_UNIX)
{ {
struct sockaddr_un *nad = (struct sockaddr_un *) address; struct sockaddr_un *nad = (struct sockaddr_un *) address;
@ -455,7 +461,9 @@ scm_addr_vector (address, proc)
ve[1] = scm_makfromstr (nad->sun_path, ve[1] = scm_makfromstr (nad->sun_path,
(scm_sizet) strlen (nad->sun_path), 0); (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; struct sockaddr_in *nad = (struct sockaddr_in *) address;
result = scm_make_vector (SCM_MAKINUM (3), SCM_UNSPECIFIED, SCM_BOOL_F); 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 static void
scm_init_addr_buffer () 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) if (sizeof (struct sockaddr_in) > scm_addr_buffer_size)
scm_addr_buffer_size = (int) sizeof (struct sockaddr_in); scm_addr_buffer_size = (int) sizeof (struct sockaddr_in);
scm_addr_buffer = scm_must_malloc (scm_addr_buffer_size, "address buffer"); scm_addr_buffer = scm_must_malloc (scm_addr_buffer_size, "address buffer");

View file

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