Skip to content

Commit

Permalink
* Fix Loader.getPlatform() detection for linux-armhf with Temuri…
Browse files Browse the repository at this point in the history
…n JDK (issue bytedeco/javacv#2001)

 * Fix `Parser` ignoring `Info.skip` for enumerators that do not get translated (issue bytedeco/javacpp-presets#1315)
 * Fix `Parser` error on C++17 style namespace declarations containing `::` separators (issue #595)
  • Loading branch information
saudet committed Mar 25, 2023
1 parent ea4e5f7 commit f9b0746
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@

* Fix `Loader.getPlatform()` detection for `linux-armhf` with Temurin JDK ([issue bytedeco/javacv#2001](https://github.com/bytedeco/javacv/issues/2001))
* Fix `Parser` ignoring `Info.skip` for enumerators that do not get translated ([issue bytedeco/javacpp-presets#1315](https://github.com/bytedeco/javacpp-presets/issues/1315))
* Fix `Parser` error on C++17 style namespace declarations containing `::` separators ([issue #595](https://github.com/bytedeco/javacpp/issues/595))
* Fix `Parser` observing `Info.virtualize` for non-virtual functions ([pull #658](https://github.com/bytedeco/javacpp/pull/658))
* Use regex in `Parser` to match more robustly templates and namespaces ([pull #657](https://github.com/bytedeco/javacpp/pull/657))
* Fix `Builder` default output path for class names with the same length ([pull #654](https://github.com/bytedeco/javacpp/pull/654))
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.32</version>
<version>1.7.36</version>
<optional>true</optional>
</dependency>
<!--
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/bytedeco/javacpp/Loader.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public static String getPlatform() {
osArch = "x86_64";
} else if (osArch.startsWith("aarch64") || osArch.startsWith("armv8") || osArch.startsWith("arm64")) {
osArch = "arm64";
} else if ((osArch.startsWith("arm")) && ((abiType.equals("gnueabihf")) || (libPath.contains("openjdk-armhf")))) {
} else if ((osArch.startsWith("arm")) && ((abiType.equals("gnueabihf")) || (libPath.contains("jdk-armhf")))) {
osArch = "armhf";
} else if (osArch.startsWith("arm")) {
osArch = "arm";
Expand Down
15 changes: 10 additions & 5 deletions src/main/java/org/bytedeco/javacpp/tools/Parser.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2013-2021 Samuel Audet
* Copyright (C) 2013-2023 Samuel Audet
*
* Licensed either under the Apache License, Version 2.0, or (at your option)
* under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -3818,7 +3818,9 @@ boolean enumeration(Context context, DeclarationList declList) throws ParserExce
} else if (context.namespace != null && context.javaName == null) {
annotations += "@Namespace(\"" + context.namespace + "\") ";
}
extraText += "\n" + annotations + "public static native @MemberGetter " + javaType + " " + javaName + "();\n";
if (info == null || !info.skip) {
extraText += "\n" + annotations + "public static native @MemberGetter " + javaType + " " + javaName + "();\n";
}
enumPrefix = "public static final " + javaType;
countPrefix = javaName + "()";
}
Expand Down Expand Up @@ -3985,10 +3987,13 @@ boolean namespace(Context context, DeclarationList declList) throws ParserExcept
String spacing = tokens.get().spacing;
String name = null;
tokens.next();
if (tokens.get().match(Token.IDENTIFIER)) {
while (tokens.get().match(Token.IDENTIFIER)) {
// get the name, unless anonymous
name = tokens.get().value;
tokens.next();
name = (name != null ? name : "") + tokens.get().value;
if (tokens.next().match("::")) {
name += tokens.get();
tokens.next();
}
}
if (tokens.get().match('=')) {
// deal with namespace aliases
Expand Down

0 comments on commit f9b0746

Please sign in to comment.