summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2009-09-15 22:33:03 +0200
committerLudovic Courtès <ludo@gnu.org>2009-09-15 22:33:03 +0200
commitaef9e3bd012fdf7b8fe126d89c48eb22019f0ec8 (patch)
tree105d68a0cf0f48cf43c4228a840b4e7c91e2f9b6
parent0a9a6d142269d54b572d19fb958309be2b5b8818 (diff)
downloadguile-aef9e3bd012fdf7b8fe126d89c48eb22019f0ec8.tar.gz
Fix the (currently unused) weak pair accessors.
* libguile/weaks.h (SCM_WEAK_PAIR_WORD): Fixed; changed to return `SCM_UNDEFINED' when the word has been nullified.
-rw-r--r--libguile/weaks.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/libguile/weaks.h b/libguile/weaks.h
index 908e27628..23b707248 100644
--- a/libguile/weaks.h
+++ b/libguile/weaks.h
@@ -3,7 +3,7 @@
#ifndef SCM_WEAKS_H
#define SCM_WEAKS_H
-/* Copyright (C) 1995,1996,2000,2001, 2003, 2006, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 1995,1996,2000,2001, 2003, 2006, 2008, 2009 Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@@ -71,10 +71,12 @@ SCM_API SCM scm_doubly_weak_pair (SCM car, SCM cdr);
((SCM_WEAK_PAIR_CAR_DELETED_P (_cell)) \
|| (SCM_WEAK_PAIR_CDR_DELETED_P (_cell)))
-/* Accessing the components of a weak cell. */
+/* Accessing the components of a weak cell. These return `SCM_UNDEFINED' if
+ the car/cdr has been collected. */
#define SCM_WEAK_PAIR_WORD(_cell, _word) \
- ((SCM_WEAK_PAIR_WORD_DELETED_P ((_cell), (_word))) \
- ? SCM_BOOL_F : SCM_CAR (pair))
+ (SCM_WEAK_PAIR_WORD_DELETED_P ((_cell), (_word)) \
+ ? SCM_UNDEFINED \
+ : SCM_CELL_OBJECT ((_cell), (_word)))
#define SCM_WEAK_PAIR_CAR(_cell) (SCM_WEAK_PAIR_WORD ((_cell), 0))
#define SCM_WEAK_PAIR_CDR(_cell) (SCM_WEAK_PAIR_WORD ((_cell), 1))