1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-15 10:10:21 +02:00

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.
This commit is contained in:
Ludovic Courtès 2009-09-15 22:33:03 +02:00
parent 0a9a6d1422
commit aef9e3bd01

View file

@ -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))