[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ffi-helper: looking for C libraries to try
From: |
Matt Wette |
Subject: |
Re: ffi-helper: looking for C libraries to try |
Date: |
Tue, 1 Aug 2017 09:20:33 -0700 |
> On Jul 15, 2017, at 6:15 AM, Matt Wette <address@hidden> wrote:
>
>
>> On Jul 14, 2017, at 9:35 PM, Matt Wette <address@hidden> wrote:
>>
>>
>>> On Jul 14, 2017, at 5:44 PM, Amirouche Boubekki <address@hidden> wrote:
>>>
>>> On 2017-07-15 01:17, Matt Wette wrote:
>>>> I tried git2 but those headers are too
>>>> broken.
>>>
>>> What do you mean by "too broken"? Maybe it will be easier in the long run
>>> to maintain our own version of the headers than manually bind everything.
>>> Even if it requires to create a shim layer in scheme to have a proper set
>>> of bindings that schemer will enjoy. Also, git is a good candidate since
>>> there are some tests already in guile-git [1].
>>
>> Maybe another bug in my CPP.
>>
>> (define-ffi-module (libgit2)
>> #:include '("git2.h")
>> #:inc-dirs '("/opt/local/include")
>> #:library '("git2")
>> )
>>
>> mwette$ guild compile-ffi libgit2.ffi
>> (unknown):1: not found: “common.h"
>>
>
> I claim libgit2 headers are broken. The standard says, essentially, “how
> headers are located is implementation defined”.
>
> The file …/include/git2.h states:
> #include “git2/annotated_commit.h”
> #include “git2/common.h”
> …
>
> But the file include/git2/annotated_commit.h states:
> #include “common.h”
>
> Note this is “common.h" not “git2/common.h” How does gcc find common.h?
> The directory include/git2 is not in the include path.
> These are the ugly, undocumented, non-standard items that scare me.
I found a reference for include file searching in gcc:
https://gcc.gnu.org/onlinedocs/cpp/Search-Path.html
I have returned to working on libgit2. It turns out glib uses this, and
include_next as well.
So I have added this behavior plus include_next. Test/debug of the fyi-helper
goes on …
I have been able too compile-ffi, almost everything from cairo, gdbm, sqlite3.
Now working on rsvp and libgit2.
Not supported so far is va-args. That will require some help from the user.
(Libffi does not support va-args.)
Matt
- Re: ffi-helper: looking for C libraries to try,
Matt Wette <=