Skip to content

Commit e8a0915

Browse files
committed
Fix bugs
1 parent 13abe05 commit e8a0915

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

src/main/java/cn/apisium/shm/CABI.java

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22

33
import org.jetbrains.annotations.NotNull;
44

5-
import static java.lang.foreign.ValueLayout.ADDRESS;
6-
75
public final class CABI {
86
/**
97
* System types.
108
*/
11-
public enum SystemType { Unknown, Windows, Unix }
9+
public enum SystemType { @SuppressWarnings("unused") Unknown, Windows, Unix }
1210

1311
/**
1412
* The current system type.
@@ -18,12 +16,7 @@ public enum SystemType { Unknown, Windows, Unix }
1816

1917
static {
2018
var OS = System.getProperty("os.name");
21-
var ARCH = System.getProperty("os.arch");
22-
var ADDRESS_SIZE = ADDRESS.byteSize();
23-
if ((ARCH.equals("amd64") || ARCH.equals("x86_64")) && ADDRESS_SIZE == 64) {
24-
SYSTEM_TYPE = OS.startsWith("Windows") ? SystemType.Windows : SystemType.Unknown;
25-
} else if (ARCH.equals("aarch64")) {
26-
SYSTEM_TYPE = SystemType.Unix;
27-
} else SYSTEM_TYPE = SystemType.Unknown;
19+
if (OS.startsWith("Windows")) SYSTEM_TYPE = SystemType.Windows;
20+
else SYSTEM_TYPE = SystemType.Unix;
2821
}
2922
}

0 commit comments

Comments
 (0)