H. S. Teoh wrote:

On Sat, Jun 10, 2017 at 02:27:13AM +0300, ketmar via Digitalmars-d wrote:
H. S. Teoh wrote:

On a tangential note, now that I finally got the miserable test
suite running, I've managed to figure out that the problem in my dmd
PR was caused by src/ddmd/globals.h not being auto-generated from
src/ddmd/globals.d, so when I added new fields to the Global struct,
the C++ code that use globals.h with the old definition crashed. I
suppose this is just a relic from the pre-self-hosting days, but it
would be nice if these last .h files were gotten rid of in the near
future.
That, or we should (ab)use the .di generation facility or some sed
script to generate these .h files, so that they won't go out-of-sync
inadvertently.
we can use UDAs to do that! just make the generator import the
relevand dmd parts, and then use compile-time introspection to build
tables, so generator can just write 'em to file in runtime. ;-)

Sure!  But ... uhm... what has UDAs gotta do with that? A straight
`foreach (memb; __traits(allMembers, T))` should do the trick.

i thought about situations where you may need to exclude something from generated header... but this surely has no sense, as one cannot exclude fields or virtual methods from generated classes, so `extern(C++)` is surely enough. well, i like to overengineer! ;-)

Reply via email to