Re: Anyone know of a C preprocessor #define introspection mechanism? (for FFI bindings)

  • From: Coda Highland <chighland@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Tue, 10 Feb 2015 18:37:23 -0800

On Tue, Feb 10, 2015 at 6:23 PM, demetri <demetri.spanos@xxxxxxxxx> wrote:
>> "gcc -dM -E file.c" will write to stdout the current set of preprocessor
>> symbols, after preprocessing file.c and anything it #includes. The same
>> will work for clang, icc and (I think) the HP and portland group compiler.
>
>
> Steve, you are my hero for the day. I suspected something like this must
> exist but I couldn't find it in the GCC/clang docs (I realize it must be
> there,
> but web searches did not get me anywhere useful).
>
> If you're ever in the San Francisco area I owe you coffee or a drink.
>
> Demetri
>

I've got some C++ code I wrote that does an equivalent task (which I
tested against a similar gcc invocation!) that I wouldn't mind
cleaning up / porting at some point if you want something embeddable.

/s/ Adam

Other related posts: