Skip to content

Commit

Permalink
* Let Generator treat long return values @ByVal or @ByRef wi…
Browse files Browse the repository at this point in the history
…th `@Cast("...*")` (issue #576)
  • Loading branch information
saudet committed Jun 6, 2022
1 parent 7dea7b5 commit 307eb90
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

* Define default `SHARED_PTR_NAMESPACE`, `UNIQUE_PTR_NAMESPACE`, `OPTIONAL_NAMESPACE` to `std` on supported compilers ([issue #577](https://github.com/bytedeco/javacpp/issues/577))
* Let `Generator` dereference `long` arguments `@ByVal` or `@ByRef` with `@Cast("...*")` ([issue #576](https://github.com/bytedeco/javacpp/issues/576))
* Let `Generator` treat `long` arguments and return values `@ByVal` or `@ByRef` with `@Cast("...*")` ([issue #576](https://github.com/bytedeco/javacpp/issues/576))
* Add `BytePointer.getUnsigned()` and `putUnsigned()` methods for convenience ([pull #574](https://github.com/bytedeco/javacpp/pull/574))
* Let `Parser` consider `alignas` as an explicit attribute to be ignored by default ([issue bytedeco/javacpp-presets#1168](https://github.com/bytedeco/javacpp-presets/issues/1168))
* Add "org.bytedeco.javacpp.findLibraries" system property to disable search for libraries ([pull #565](https://github.com/bytedeco/javacpp/pull/565))
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/bytedeco/javacpp/tools/Generator.java
Original file line number Diff line number Diff line change
Expand Up @@ -2415,6 +2415,8 @@ String returnBefore(MethodInformation methodInfo) {
returnPrefix = typeName[0] + " rval" + typeName[1] + " = " + cast;
if ((returnBy instanceof ByPtr) || (returnBy instanceof ByPtrRef)) {
returnPrefix += "*";
} else if ((returnBy instanceof ByVal || returnBy instanceof ByRef) && cast.endsWith("*)")) {
returnPrefix += "&";
}
} else if (Enum.class.isAssignableFrom(methodInfo.returnType)) {
accessesEnums = true;
Expand Down

0 comments on commit 307eb90

Please sign in to comment.