Skip to content

Commit

Permalink
* Prevent Parser from outputting cast methods for base classes tha…
Browse files Browse the repository at this point in the history
…t are `Info.skip` (pull #607)
  • Loading branch information
domcir authored Sep 22, 2022
1 parent 8eaa43a commit f77f8d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

* Prevent `Parser` from outputting cast methods for base classes that are `Info.skip` ([pull #607](https://github.com/bytedeco/javacpp/pull/607))
* Ensure `Generator` and `Parser` process header files from `cinclude` before `include` ([issue #580](https://github.com/bytedeco/javacpp/issues/580))
* Remove `sun.misc.Unsafe` config incompatible/unneeded with GraalVM Native Image 22.x ([issue bytedeco/sample-projects#63](https://github.com/bytedeco/sample-projects/issues/63))
* Define default `SHARED_PTR_NAMESPACE`, `UNIQUE_PTR_NAMESPACE`, `OPTIONAL_NAMESPACE` to `std` on supported compilers ([issue #577](https://github.com/bytedeco/javacpp/issues/577))
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/bytedeco/javacpp/tools/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -3380,7 +3380,8 @@ boolean group(Context context, DeclarationList declList) throws ParserException
String casts = "";
if (baseClasses.size() > 0) {
for (Type t : baseClasses) {
if (!t.javaName.equals("Pointer")) {
Info baseInfo = infoMap.getFirst(t.cppName);
if (!t.javaName.equals("Pointer") && (baseInfo == null || !baseInfo.skip)) {
String shortName = t.javaName.substring(t.javaName.lastIndexOf('.') + 1);
casts += " public " + t.javaName + " as" + shortName + "() { return as" + shortName + "(this); }\n"
+ " @Namespace public static native @Name(\"static_cast<" + t.cppName + "*>\") "
Expand Down

0 comments on commit f77f8d7

Please sign in to comment.