From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Kjetil S. Matheussen" Newsgroups: gmane.lisp.guile.devel Subject: Re: Passing C pointers through guile Date: Wed, 9 Jul 2008 20:32:27 +0200 (CEST) Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: ger.gmane.org 1215628379 26680 80.91.229.12 (9 Jul 2008 18:32:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 9 Jul 2008 18:32:59 +0000 (UTC) Cc: guile-devel@gnu.org To: "Kjetil S. Matheussen" Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Jul 09 20:33:44 2008 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KGeTp-0001BD-AM for guile-devel@m.gmane.org; Wed, 09 Jul 2008 20:33:29 +0200 Original-Received: from localhost ([127.0.0.1]:59091 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KGeSx-0007fE-Nj for guile-devel@m.gmane.org; Wed, 09 Jul 2008 14:32:35 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KGeSv-0007ea-2i for guile-devel@gnu.org; Wed, 09 Jul 2008 14:32:33 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KGeSs-0007e3-MR for guile-devel@gnu.org; Wed, 09 Jul 2008 14:32:31 -0400 Original-Received: from [199.232.76.173] (port=35018 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KGeSs-0007dt-Db for guile-devel@gnu.org; Wed, 09 Jul 2008 14:32:30 -0400 Original-Received: from mail-out1.uio.no ([129.240.10.57]:59224) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KGeSr-0007r3-Oq for guile-devel@gnu.org; Wed, 09 Jul 2008 14:32:30 -0400 Original-Received: from mail-mx3.uio.no ([129.240.10.44]) by mail-out1.uio.no with esmtp (Exim 4.69) (envelope-from ) id 1KGeSq-00087K-Mm for guile-devel@gnu.org; Wed, 09 Jul 2008 20:32:28 +0200 Original-Received: from notam02.uio.no ([129.240.197.34]) by mail-mx3.uio.no with esmtp (Exim 4.67) (envelope-from ) id 1KGeSq-00010U-IC; Wed, 09 Jul 2008 20:32:28 +0200 Original-Received: from kjetism (helo=localhost) by notam02.uio.no with local-esmtp (Exim 4.44) id 1KGeSq-0003OL-Bq; Wed, 09 Jul 2008 20:32:28 +0200 X-X-Sender: kjetism@notam02.uio.no In-Reply-To: X-UiO-Spam-info: not spam, SpamAssassin (score=-5.0, required=5.0, autolearn=disabled, UIO_MAIL_IS_INTERNAL=-5, uiobl=NO, uiouri=NO) X-UiO-Scanned: 4C8E8461BD532024928B7F37DE4E7EE4A51D7948 X-UiO-SPAM-Test: remote_host: 129.240.197.34 spam_score: -49 maxlevel 200 minaction 1 bait 0 mail/h: 1 total 9490 max/h 25 blacklist 0 greylist 0 ratelimit 0 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:7358 Archived-At: On Wed, 9 Jul 2008, Kjetil S. Matheussen wrote: > > 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) > Stupid me. I could of course compile 1.8.5 since I have autoconf 1.60. And by doing that, I found three trivial typos. New version of http://www.notam02.no/~kjetism/libguile.diff is uploaded. However, I can't get it to work...: " kjetil@ttleush ~/guile-1.8.5 $ CFLAGS=-O3 ./configure --prefix=/home/kjetil/guile-1.8.5 --without-threads ... kjetil@ttleush ~/guile-1.8.5 $ make && make install ... kjetil@ttleush ~/guile-1.8.5 $ more test.c #include #include int main(){ SCM t=scm_from_uintptr((scm_t_uintptr)&main); scm_t_uintptr m=scm_to_uintptr(t); printf("main: %p, p: %x\n",&main,m); return 0; } kjetil@ttleush ~/guile-1.8.5 $ gcc -Iinclude/ -Llib lib/libguile.a test.c /tmp/ccMcEAxd.o: In function `main': test.c:(.text+0x1b): undefined reference to `scm_from_uintptr' test.c:(.text+0x2c): undefined reference to `scm_to_uintptr' collect2: ld returned 1 exit status kjetil@ttleush ~/guile-1.8.5 $ " Any idea why?