Dushistov / flapigen-rs

Tool for connecting programs or libraries written in Rust with other languages
BSD 3-Clause "New" or "Revised" License
775 stars 59 forks source link

Better support for C enum. #425

Closed stephan57160 closed 2 years ago

stephan57160 commented 2 years ago

See discussion in #419.

Create a 'enum' in .h file, with same values than in C++. Difference are the names of the 'constants' : In C, the enum name is prepended before the RUST enum name.

Testing tool are also available in tests/expectations.

Note:

stephan57160 commented 2 years ago

I see also a conflicting files, which was nos there previsously. I'll change that too, no problem.

You prefer different commits, or a squash of all ?

Dushistov commented 2 years ago

You prefer different commits, or a squash of all ?

I suppose "squash" is better for such small feature, too make life easier during "git bisect".

I see also a conflicting files

I removed empty line in enum generator, and I suppose this is cause conflicts.

stephan57160 commented 2 years ago

New tests added, after seeing the new enum syntax.

stephan57160 commented 2 years ago

You prefer different commits, or a squash of all ?

I suppose "squash" is better for such small feature, too make life easier during "git bisect".

I see also a conflicting files

I removed empty line in enum generator, and I suppose this is cause conflicts.

No. Mistake was on my side. I simply did not fetch upstream/master and did not get the new 'enum syntax' PR. Before I understood this, I had a few push attempts ... It's fixed now, and I added some more tests, with this too.