summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtyom V. Poptsov <poptsov.artyom@gmail.com>2017-05-22 00:42:48 +0300
committerArtyom V. Poptsov <poptsov.artyom@gmail.com>2017-05-22 00:42:48 +0300
commit10b87274efdfe262a2fc8d9aee4596c03533a939 (patch)
treeedd32c6c045d1d4f639bc63416a50b82679b525d
parentchannel-func.c (guile_ssh_channel_get_exit_status): Handle freed channels (diff)
downloadguile-ssh-10b87274efdfe262a2fc8d9aee4596c03533a939.tar.gz
channel-type.c (print_channel): Add a check for Guile 2.2
* libguile-ssh/channel-type.c (print_channel): Don't use 'SCM_PTAB_ENTRY' macro if Guile 2.2 is used. * libguile-ssh/channel-type.h (GSSH_VALIDATE_CHANNEL_DATA): Likewise.
-rw-r--r--libguile-ssh/channel-type.c4
-rw-r--r--libguile-ssh/channel-type.h11
2 files changed, 15 insertions, 0 deletions
diff --git a/libguile-ssh/channel-type.c b/libguile-ssh/channel-type.c
index cc9dae6..ff0df5e 100644
--- a/libguile-ssh/channel-type.c
+++ b/libguile-ssh/channel-type.c
@@ -246,8 +246,12 @@ print_channel (SCM channel, SCM port, scm_print_state *pstate)
{
struct channel_data *ch = NULL;
+#if USING_GUILE_BEFORE_2_2
if (SCM_PTAB_ENTRY (channel))
ch = _scm_to_channel_data (channel);
+#else
+ ch = _scm_to_channel_data (channel);
+#endif
scm_puts ("#<", port);
diff --git a/libguile-ssh/channel-type.h b/libguile-ssh/channel-type.h
index 2584dde..6a29fed 100644
--- a/libguile-ssh/channel-type.h
+++ b/libguile-ssh/channel-type.h
@@ -42,6 +42,8 @@ struct channel_data {
} while (0)
/* Make sure that the channel SCM is open. */
+#if USING_GUILE_BEFORE_2_2
+
#define GSSH_VALIDATE_OPEN_CHANNEL(scm, pos, fn) \
do { \
if (! SCM_PTAB_ENTRY (channel)) \
@@ -49,6 +51,15 @@ struct channel_data {
SCM_ASSERT_TYPE (SCM_OPPORTP (scm), scm, pos, fn, "open channel"); \
} while (0)
+#else
+
+#define GSSH_VALIDATE_OPEN_CHANNEL(scm, pos, fn) \
+ do { \
+ SCM_ASSERT_TYPE (SCM_OPPORTP (scm), scm, pos, fn, "open channel"); \
+ } while (0)
+
+#endif /* USING_GUILE_BEFORE_2_2 */
+
/* API */