Skip to content

Commit

Permalink
* Let Parser check Info.skipDefaults also for types to ignore de…
Browse files Browse the repository at this point in the history
…fault constructors (issue #493)
  • Loading branch information
saudet committed Jun 30, 2021
1 parent a6320a5 commit 0d49924
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

* Let `Parser` check `Info.skipDefaults` also for types to ignore default constructors ([issue #493](https://github.com/bytedeco/javacpp/issues/493))
* Fix `Parser` failure on `enum` declarations without enumerators
* Let `Generator` use the third element of `@Cast(value)` on return values passed to adapters ([issue tensorflow/java#345](https://github.com/tensorflow/java/issues/345))
* Prevent `Generator` from swallowing exceptions caught on `Buffer.array()` ([pull #504](https://github.com/bytedeco/javacpp/pull/504))
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/bytedeco/javacpp/tools/Info.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public Info(Info i) {
/** Skips entirely all the code associated with the C++ identifiers, expressions, or header filenames.
* Unless more {@link Info} is provided... */
boolean skip = false;
/** Ignores default function arguments to avoid ambiguous C++ function calls. */
/** Ignores default type constructors and default function arguments to avoid ambiguous C++ function calls. */
boolean skipDefaults = false;
/** Forces a class to be treated as if it were abstract. */
boolean purify = false;
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/bytedeco/javacpp/tools/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -3512,7 +3512,9 @@ boolean group(Context context, DeclarationList declList) throws ParserException
" }\n";
}
}
decl.text += constructors;
if (info == null || !info.skipDefaults) {
decl.text += constructors;
}
declList.spacing = spacing;
decl.text = declList.rescan(decl.text + casts + "\n");
declList.spacing = null;
Expand Down

0 comments on commit 0d49924

Please sign in to comment.