Represent enums as enums, not int, if possible
Use enum types instead of int for the enum-valued parameters and function return values, this is more type-safe and clear for the users of the library. Change cpp_enum unit test to use C++ to check that C++ enum wrappers can at least be compiled, but still use C API in it. Note that enum whose underlying type is bigger than int still don't work, but this is no different from what it was before, so just document this limitation but don't do anything else about it for now. This commit is best viewed ignoring whitespace-only changes.
This commit is contained in:
parent
815c7c0361
commit
579c343d5f
4 changed files with 198 additions and 96 deletions
|
|
@ -664,6 +664,7 @@ C++ wrappers try to provide a similar API to the original C++ API being wrapped,
|
|||
Other ones are due to things that could be supported but haven't been implemented yet:
|
||||
<ul>
|
||||
<li>Only single, not multiple, inheritance is currently supported.</li>
|
||||
<li>Only enums using <tt>int</tt> (or smaller type) as underlying type are supported.</li>
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue