summaryrefslogtreecommitdiff
path: root/guile/src
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2009-09-28 22:46:33 +0200
committerLudovic Courtès <ludo@gnu.org>2009-09-28 22:47:08 +0200
commitb595d1625e13a1836df6504ee1bafe1ef067726f (patch)
treebfc31410d72a750c851d59c9c8cfce91f7dd4d85 /guile/src
parentcf61dc7006b8789951b058573ae1f824b264bd96 (diff)
downloadgnutls-b595d1625e13a1836df6504ee1bafe1ef067726f.tar.gz
guile: Adjust for Guile 1.9.3+.
* guile/src/core.c (mark_session_record_port, free_session_record_port): Conditionalize on `SCM_MAJOR_VERSION == 1 && SCM_MINOR_VERSION <= 8'. (scm_init_gnutls_session_record_port_type): Adjust accordingly. (make_session_record_port): Use `scm_gc_malloc_pointerless ()' when available.
Diffstat (limited to 'guile/src')
-rw-r--r--guile/src/core.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/guile/src/core.c b/guile/src/core.c
index da711c216e..c0ded90166 100644
--- a/guile/src/core.c
+++ b/guile/src/core.c
@@ -720,6 +720,9 @@ static scm_t_bits session_record_port_type;
static const char session_record_port_gc_hint[] =
"gnutls-session-record-port";
+
+#if SCM_MAJOR_VERSION == 1 && SCM_MINOR_VERSION <= 8
+
/* Mark the session associated with PORT. */
static SCM
mark_session_record_port (SCM port)
@@ -755,9 +758,11 @@ free_session_record_port (SCM port)
return 0;
}
-
#undef FUNC_NAME
+#endif /* SCM_MAJOR_VERSION == 1 && SCM_MINOR_VERSION <= 8 */
+
+
/* Data passed to `do_fill_port ()'. */
typedef struct
{
@@ -865,7 +870,12 @@ make_session_record_port (SCM session)
c_port_buf =
(unsigned char *)
- scm_gc_malloc (SCM_GNUTLS_SESSION_RECORD_PORT_BUFFER_SIZE,
+#ifdef HAVE_SCM_GC_MALLOC_POINTERLESS
+ scm_gc_malloc_pointerless
+#else
+ scm_gc_malloc
+#endif
+ (SCM_GNUTLS_SESSION_RECORD_PORT_BUFFER_SIZE,
session_record_port_gc_hint);
/* Create a new port. */
@@ -921,8 +931,14 @@ scm_init_gnutls_session_record_port_type (void)
scm_make_port_type ("gnutls-session-port",
fill_session_record_port_input,
write_to_session_record_port);
+
+ /* Guile >= 1.9.3 doesn't need a custom mark procedure, and doesn't need a
+ finalizer (since memory associated with the port is automatically
+ reclaimed.) */
+#if SCM_MAJOR_VERSION == 1 && SCM_MINOR_VERSION <= 8
scm_set_port_mark (session_record_port_type, mark_session_record_port);
scm_set_port_free (session_record_port_type, free_session_record_port);
+#endif
}