Skip to content

Commit

Permalink
impl arm to NativeCode
Browse files Browse the repository at this point in the history
  • Loading branch information
Outfluencer authored Sep 4, 2024
1 parent 9c0a436 commit c6b725a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion native/src/main/java/net/md_5/bungee/jni/NativeCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public boolean load()
{
if ( enableNativeFlag && !loaded && isSupported() )
{
String name = this.name + ( isAarch64() ? "-arm" : "" );
String fullName = "bungeecord-" + name;

try
Expand Down Expand Up @@ -94,6 +95,16 @@ public boolean load()

public static boolean isSupported()
{
return "Linux".equals( System.getProperty( "os.name" ) ) && "amd64".equals( System.getProperty( "os.arch" ) );
return "Linux".equals( System.getProperty( "os.name" ) ) && ( isAmd64() || isAarch64() );
}

private static boolean isAmd64()
{
return "amd64".equals( System.getProperty( "os.arch" ) );
}

private static boolean isAarch64()
{
return "aarch64".equals( System.getProperty( "os.arch" ) );
}
}

0 comments on commit c6b725a

Please sign in to comment.