[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Passing C pointers through guile

From: Kjetil S. Matheussen
Subject: Re: Passing C pointers through guile
Date: Wed, 9 Jul 2008 18:50:51 +0200 (CEST)

Ludovic Court?s:
> scenes.
> > I agree with Maciek that it would at least be mind-comforting to have
> > functions like scm_to_ptr/etc, although not strictly necessary,
> > since using integers works just fine.
> `scm_{to,from}_uintptr ()' could be handy (patches welcome!).

I gave it a try. Unfortunately, I was completely unable to create
the configure file right now, so the patch is against 1.8.5 (sorry
if this creats trouble against git repository), and
it's also untested, since I couldn't build configure. However,
the patches are trivial, so I think they work anyway. (crossing fingers)

The only thing I'm not too sure about is whether
the new SCM_I_GSC_T_UINTPTR type in will actually be
optional or not. I just copied the checking code for the optional
SCM_I_GSC_T_UINT64 type though:

### Optional type scm_t_uintptr
if test "$scm_stdint_has_uintptr"; then
elif test "$scm_inttypes_has_uintptr"; then
  AC_MSG_ERROR([Can't find appropriate type for scm_t_uintptr.])

Patch for

Patch for libguile/, libguile/__scm.h, 
libguile/gen-scmconfig.c, libguile/ and 

The two patches are also attached.

> That said, using a Scheme integer to represent a pointer wouldn't be
> efficient (pointers would likely translate to bignums).

I think cleaner code would usually be more important in this case,
but at least there will be a choice.

Attachment: libguile.diff
Description: Text document

Description: Text document

reply via email to

[Prev in Thread] Current Thread [Next in Thread]