guile-user
[Top][All Lists]
Advanced

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

Re: #define SOMETHING some_value


From: Mark H Weaver
Subject: Re: #define SOMETHING some_value
Date: Sun, 11 Jun 2017 15:42:19 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

Amirouche Boubekki <address@hidden> writes:

> What I do is that I hardcode the define in scheme using simple define form
>
> for instance, the following:
>
> #define SOMETHING some_value
>
> Becomes:
>
> (define SOMETHING some_value)

Right.  Unfortunately, preprocessor macros are replaced with their
right-hand-sides in the first phase of C compilation (preprocessing),
and then forgotten.  These macros are not stored in the shared objects,
so it's simply not possible for us to retrieve them.

For this reason, I'm sorry to say that the association between SOMETHING
and some_value must be redundantly represented in your Guile bindings,
as Amirouche describes above.

It would be nice to have a tool to extract this information from .h
files automatically, but since there's no guarantee that the .h files
are present on the user's machine at run time, nor is there a robust way
to find those .h files, this would be a tool for your convenience as a
developer, and would still require you to redundantly store the output
of this tool in your Scheme sources.

I'm sorry that I don't have a better answer for you.

      Mark



reply via email to

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