summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2010-04-01 16:37:28 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2010-04-01 16:37:28 +0300
commit42f9e9d0e3c73059048934e385074d78a023e6e4 (patch)
tree9f6342bac8b2339455f75194afb24134f495c707
parent43a43a758881ae1294b73696175bc066e9257aa2 (diff)
downloadmailutils-42f9e9d0e3c73059048934e385074d78a023e6e4.tar.gz
mailutils-42f9e9d0e3c73059048934e385074d78a023e6e4.tar.bz2
Fix the use of deprecated Guile interfaces in port code.
* am/guile.m4 (MU_CHECK_GUILE): Check for SCM_DEVAL_P et al. * libmu_scm/mu_guile.c (mu_guile_init): Protect calls to SCM_DEVAL_P &c. by #ifdef GUILE_DEBUG_MACROS * libmu_scm/mu_port.c [!HAVE_SCM_T_OFF](scm_t_off): New typedef. (mu_port_make_from_stream): Use scm_new_port_table_entry instead of the deprecated scm_add_to_port_table
-rw-r--r--am/guile.m411
-rw-r--r--libmu_scm/mu_guile.c2
-rw-r--r--libmu_scm/mu_port.c15
3 files changed, 21 insertions, 7 deletions
diff --git a/am/guile.m4 b/am/guile.m4
index f04903739..64b5cace9 100644
--- a/am/guile.m4
+++ b/am/guile.m4
@@ -63,6 +63,17 @@ AC_DEFUN([MU_CHECK_GUILE],
GUILE_VERSION_NUMBER=
m4_if($3,,[AC_MSG_ERROR(required library libguile not found)], [$3])
else
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <libguile.h>]],
+ [SCM_DEVAL_P = 1;
+ SCM_BACKTRACE_P = 1;
+ SCM_RECORD_POSITIONS_P = 1;
+ SCM_RESET_DEBUG_MODE;])],
+ [mu_cv_guile_debug=yes],
+ [mu_cv_guile_debug=no])
+ if test $mu_cv_guile_debug = yes; then
+ AC_DEFINE_UNQUOTED(GUILE_DEBUG_MACROS, 1,
+ [Define to 1 if SCM_DEVAL_P, SCM_BACKTRACE_P, SCM_RECORD_POSITIONS_P and SCM_RESET_DEBUG_MODE are defined])
+ fi
AC_CHECK_TYPES([scm_t_off],[],[],[#include <libguile.h>])
AC_DEFINE_UNQUOTED(GUILE_VERSION, "$GUILE_VERSION",
[Guile version number])
diff --git a/libmu_scm/mu_guile.c b/libmu_scm/mu_guile.c
index b5cd26175..26dc2a7d4 100644
--- a/libmu_scm/mu_guile.c
+++ b/libmu_scm/mu_guile.c
@@ -109,10 +109,12 @@ mu_guile_init (int debug)
if (debug)
{
+#ifdef GUILE_DEBUG_MACROS
SCM_DEVAL_P = 1;
SCM_BACKTRACE_P = 1;
SCM_RECORD_POSITIONS_P = 1;
SCM_RESET_DEBUG_MODE;
+#endif
}
mu_scm_init ();
}
diff --git a/libmu_scm/mu_port.c b/libmu_scm/mu_port.c
index 8b2906cf6..6f3e4528a 100644
--- a/libmu_scm/mu_port.c
+++ b/libmu_scm/mu_port.c
@@ -20,6 +20,10 @@
#include "mu_scm.h"
#include <mailutils/io.h>
+#ifndef HAVE_SCM_T_OFF
+typedef off_t scm_t_off;
+#endif
+
struct mu_port
{
mu_stream_t stream; /* Associated stream */
@@ -87,16 +91,13 @@ mu_port_make_from_stream (SCM msg, mu_stream_t stream, long mode)
mp->stream = stream;
mp->offset = 0;
- port = scm_cell (scm_tc16_smuport | mode, 0);
-
- pt = scm_add_to_port_table (port);
- SCM_SETPTAB_ENTRY (port, pt);
+ port = scm_new_port_table_entry (scm_tc16_smuport | mode);
+ pt = SCM_PTAB_ENTRY (port);
pt->rw_random = mu_stream_is_seekable (stream);
-
SCM_SETSTREAM (port, mp);
mu_port_alloc_buffer (port, 0, 0);
-
- /* SCM_PTAB_ENTRY (port)->file_name = "name";FIXME*/
+ /* FIXME:
+ SCM_PTAB_ENTRY (port)->file_name = "name";*/
return port;
}

Return to:

Send suggestions and report system problems to the System administrator.