Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
taoliult committed Nov 14, 2023
1 parent 2a5eac8 commit 194ecc5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ public static void main(String[] args) throws Exception {
}

// Filter out platform-unrelated ones. We only support
// #ifdef, #ifndef, #else, and #endif. Nesting not supported (yet).
// #ifdef, #ifndef, #else, #endif and #if defined A || B.
// Other Nesting not supported (yet).
int mode = 0; // 0: out of block, 1: in match, 2: in non-match
Iterator<String> iter = lines.iterator();
while (iter.hasNext()) {
Expand All @@ -113,6 +114,18 @@ public static void main(String[] args) throws Exception {
mode = line.endsWith(args[2]) ? 2 : 1;
}
iter.remove();
} else if (line.startsWith("#if defined ")) {
for (String l : line.split("\\|\\|")) {
if (l.indexOf('-') > 0) {
mode = l.trim().endsWith(args[2] + "-" + args[3]) ? 1 : 2;
} else {
mode = l.trim().endsWith(args[2]) ? 1 : 2;
}
if (mode == 1) {
break;
}
}
iter.remove();
} else if (line.startsWith("#else")) {
if (mode == 0) {
throw new IllegalStateException("#else not in #if block");
Expand Down
2 changes: 1 addition & 1 deletion src/java.base/share/conf/security/java.security
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ security.provider.tbd=Apple
#endif
security.provider.tbd=SunPKCS11

#if defined (linux-x86) || defined (linux-ppc64le) || defined (linux-s390x)
#if defined linux-x86 || defined linux-ppc64le || defined linux-s390x
#
# Java Restricted Security Mode
#
Expand Down

0 comments on commit 194ecc5

Please sign in to comment.