summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Vollmer <mvo@zagadka.de>2005-06-05 18:27:53 +0000
committerMarius Vollmer <mvo@zagadka.de>2005-06-05 18:27:53 +0000
commitecc9f40fe57d5c484564d90e930f519521731b0a (patch)
tree441df911a725cb99c8f1da3abf203fd20758f86f
parent875a58aa81cd6f204140bd1579cfa400dfce6b55 (diff)
downloadguile-ecc9f40fe57d5c484564d90e930f519521731b0a.tar.gz
* hashtab.h: Bugfix: use SCM_API (WAS: extern).
* socket.c: Remove obsolete comment about socklen_t. (s_scm_setsockopt)[!HAVE_IP_MREQ]: Do not use ip_mreq code. * numbers.h (isnan)[__MINGW32__]: Remove. * Makefile.am (gen_scmconfig_SOURCES): Bugfix: Add DEFAULT_INCLUDES when cross compiling. * threads.c (ETIMEDOUT, pipe)[__MINGW32__]: Add defines. * stime.c (s_scm_strftime)[!HAVE_TM_ZONE]: Use SCM_SIMPLE_VECTOR_REF instead of SCM_VELTS. (Changed slightly from Jan's patch.)
-rw-r--r--libguile/Makefile.am2
-rw-r--r--libguile/hashtab.h2
-rw-r--r--libguile/numbers.h1
-rw-r--r--libguile/socket.c9
-rw-r--r--libguile/stime.c11
-rw-r--r--libguile/threads.c9
6 files changed, 21 insertions, 13 deletions
diff --git a/libguile/Makefile.am b/libguile/Makefile.am
index 52e41d09e..083129b71 100644
--- a/libguile/Makefile.am
+++ b/libguile/Makefile.am
@@ -42,7 +42,7 @@ gen_scmconfig_SOURCES = gen-scmconfig.c
## For some reason, OBJEXT does not include the dot
gen-scmconfig.$(OBJEXT): gen-scmconfig.c
if [ "$(cross_compiling)" = "yes" ]; then \
- $(CC_FOR_BUILD) $(DEFS) $(INCLUDES) -c -o $@ $<; \
+ $(CC_FOR_BUILD) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o $@ $<; \
else \
$(COMPILE) -c -o $@ $<; \
fi
diff --git a/libguile/hashtab.h b/libguile/hashtab.h
index bbf52a29c..eeb479929 100644
--- a/libguile/hashtab.h
+++ b/libguile/hashtab.h
@@ -31,7 +31,7 @@
#define SCM_HASHTABLEF_WEAK_CAR SCM_WVECTF_WEAK_KEY
#define SCM_HASHTABLEF_WEAK_CDR SCM_WVECTF_WEAK_VALUE
-extern scm_t_bits scm_tc16_hashtable;
+SCM_API scm_t_bits scm_tc16_hashtable;
#define SCM_HASHTABLE_P(x) SCM_SMOB_PREDICATE (scm_tc16_hashtable, x)
#define SCM_VALIDATE_HASHTABLE(pos, arg) \
diff --git a/libguile/numbers.h b/libguile/numbers.h
index 8b6e63805..72caa478b 100644
--- a/libguile/numbers.h
+++ b/libguile/numbers.h
@@ -92,7 +92,6 @@
# include <float.h>
# ifdef __MINGW32__
# define copysign _copysign
-# define isnan _isnan
# define finite _finite
# endif /* __MINGW32__ */
# endif /* ndef GO32 */
diff --git a/libguile/socket.c b/libguile/socket.c
index 0d2ccbdc1..c268d5e4e 100644
--- a/libguile/socket.c
+++ b/libguile/socket.c
@@ -67,10 +67,6 @@
+ strlen ((ptr)->sun_path))
#endif
-/* we are not currently using socklen_t. it's not defined on all systems,
- so would need to be checked by configure. in the meantime, plain
- int is the best alternative. */
-
SCM_DEFINE (scm_htons, "htons", 1, 0, 0,
@@ -550,7 +546,10 @@ SCM_DEFINE (scm_setsockopt, "setsockopt", 4, 0, 0,
#ifdef HAVE_STRUCT_LINGER
struct linger opt_linger;
#endif
+
+#if HAVE_STRUCT_IP_MREQ
struct ip_mreq opt_mreq;
+#endif
const void *optval = NULL;
socklen_t optlen = 0;
@@ -602,6 +601,7 @@ SCM_DEFINE (scm_setsockopt, "setsockopt", 4, 0, 0,
}
}
+#if HAVE_STRUCT_IP_MREQ
if (ilevel == IPPROTO_IP &&
(ioptname == IP_ADD_MEMBERSHIP || ioptname == IP_DROP_MEMBERSHIP))
{
@@ -612,6 +612,7 @@ SCM_DEFINE (scm_setsockopt, "setsockopt", 4, 0, 0,
optlen = sizeof (opt_mreq);
optval = &opt_mreq;
}
+#endif
if (optval == NULL)
{
diff --git a/libguile/stime.c b/libguile/stime.c
index 626dc8658..8dd1f8869 100644
--- a/libguile/stime.c
+++ b/libguile/stime.c
@@ -653,19 +653,18 @@ SCM_DEFINE (scm_strftime, "strftime", 2, 0, 0,
environment. interrupts and thread switching must be deferred
until TZ is restored. */
char **oldenv = NULL;
- SCM *velts = (SCM *) SCM_VELTS (stime);
+ SCM zone_spec = SCM_SIMPLE_VECTOR_REF (stime, 10);
int have_zone = 0;
- if (scm_is_true (velts[10]) && *SCM_STRING_CHARS (velts[10]) != 0)
+ if (scm_is_true (zone_spec) && scm_c_string_length (zone_spec) > 0)
{
/* it's not required that the TZ setting be correct, just that
it has the right name. so try something like TZ=EST0.
using only TZ=EST would be simpler but it doesn't work on
some OSs, e.g., Solaris. */
SCM zone =
- scm_string_append (scm_cons (velts[10],
- scm_cons (scm_from_locale_string ("0"),
- SCM_EOL)));
+ scm_string_append (scm_list_2 (zone_spec,
+ scm_from_locale_string ("0")));
have_zone = 1;
SCM_CRITICAL_SECTION_START;
@@ -690,7 +689,7 @@ SCM_DEFINE (scm_strftime, "strftime", 2, 0, 0,
#if !defined (HAVE_TM_ZONE)
if (have_zone)
{
- restorezone (velts[10], oldenv, FUNC_NAME);
+ restorezone (zone_spec, oldenv, FUNC_NAME);
SCM_CRITICAL_SECTION_END;
}
#endif
diff --git a/libguile/threads.c b/libguile/threads.c
index b0a15e2ca..329049cfa 100644
--- a/libguile/threads.c
+++ b/libguile/threads.c
@@ -43,6 +43,15 @@
#include "libguile/continuations.h"
#include "libguile/init.h"
+#ifdef __MINGW32__
+#ifndef ETIMEDOUT
+# define ETIMEDOUT WSAETIMEDOUT
+#endif
+# include <fcntl.h>
+# include <process.h>
+# define pipe(fd) _pipe (fd, 256, O_BINARY)
+#endif /* __MINGW32__ */
+
/*** Queues */
/* Make an empty queue data structure.