As indentation is a very handy way to structure comments and increase
their readability as much of it as possible should be preserved.
This removes any trimming of leading white spaces and ensures that
any cbindgen annotations are still recognized afterwards.
... fixes#184
Rustc already removes all leading `/` symbols during the conversion
from doc-comments into annotations. Any additional trimming of non
whitespace characters just reduces the formatting flexibility of a
comment.
... fixes#374
This required two changes in parallel.
As a first and obvious step it removes a check that skipped emptys
lines during documentation loading, but it was also necessary to
refactore the `get_comment_lines()` utility method as a second step.
This second refactoring was necessary as each line in a doc comment
is trimmed and transformed in its own doc attribute. The attribute
of an empty line therefore contains an empty string as value. If we
now call `lines()` on such an empty string we end up with an empty
iterator as the method is internally configured to ignore trailing
empty lines.
Using operator= is not quite sound in presence of destructors and operator
overloading.
It's perfectly fine to assume that the left-hand-side of an operator= expression
is valid memory, however we're using uninitialized memory here, that may not be
the case.
Use placement new to properly construct tagged unions. I don't need this with
any urgency, but it's the right thing to do in presence of complex types, and
the current code seems a bomb waiting to explode :)
This trades the ABI-safety (making the struct potentially unsafe to pass by
value), thus the opt-in rather than auto-generating it.
The TL;DR is that I need a way to share types that contain boxed slices from the
style system. That's fine when they're inside regular structs, since C++ does
the right thing, but for unions you need to make it explicit like this.
The actual Gecko setup will hook into the leak logging machinery to avoid silly
leaks and such of course.
Fixes#123:
- Adds visibility check for module-level constants.
- Adds visibility check for associated constants.
- Fixes bitflags expansion to produce public associated constants (as the real expansion does).
In modern C (post-C99) it's common to just use `// double-slash comments`, but currently cbindgen provides only `/* block-comment */` and `/// triple-slash comment` variants.
* Ignoring IDE files.
* Addresses issue #302, also amends #59 insofar that vanilla C-style now does not prefix individual lines with `*` anymore.
* Removed Javadoc reference.
* Renamed `Doxylight` to `Doxy` and changed C default to that.
* Added documentation.
* Changed enum name and applied `fmt`.
* Fixed comment.
* Fixed match.
This fixes one of my pet-peeves. Without this patch, I need to add them manually
using the raw body stuff, or along the code that accesses the struct member,
none of those being ideal.
Opt-in since it uses a C++17 feature, but this allow exactly the same usage in
C++ and Rust, which I think is nice.
This also fixes constants of transparent structs in general, since the initial
version of this patch broke a test (associated constants in enums), so I added a
test for that too.
Fix#238
This ensures that constants of a struct type have their type and the
type of their underlying value expressions renamed in the case of a
prefix.