chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] define-foreign-enum with a typedef


From: Shawn Rutledge
Subject: Re: [Chicken-users] define-foreign-enum with a typedef
Date: Thu, 13 Dec 2007 18:48:09 -0700

On Dec 13, 2007 6:35 PM, Zbigniew <address@hidden> wrote:
> Well, there is the define-enum macro in miscmacros.  It does use
> define-constant, but could be tweaked.

Then you're counting on the Scheme enum definition to be manually kept
in sync with the C one, aren't you?  Sure I can just write a few
(define )'s (all 3 of them :-) but I thought the foreign-enum macro
would result in Scheme symbols being bound to the C definition of each
enum value, so that if you compile the same egg against an updated
header, the existing symbols will be bound to the new C values (and
you still have to manually add new ones, if new ones were added on the
C side).  If the C header does not specify that the first enum is
zero, it's inelegant for me to (define) the first value as zero, on
the assumption that's what the compiler is going to assign to it.

But if easyffi can directly parse the header and generate the
definitions, that's even better.




reply via email to

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