Skip to content

Commit 87832c0

Browse files
committed
cpu_arch native fallback
1 parent 6acba74 commit 87832c0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

+stdlib/cpu_arch.m

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

33
function a = cpu_arch()
44

5-
a = '';
6-
75
if stdlib.has_dotnet()
86
a = System.Runtime.InteropServices.RuntimeInformation.OSArchitecture;
97
% https://learn.microsoft.com/en-us/dotnet/core/compatibility/interop/7.0/osarchitecture-emulation
108
elseif stdlib.has_java()
119
a = javaMethod("getProperty", "java.lang.System", "os.arch");
10+
else
11+
a = computer('arch');
1212
end
1313

1414
try %#ok<*TRYNC>

test/TestSys.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function test_cpu_arch(tc)
6969
tc.assumeTrue(stdlib.has_dotnet() || stdlib.has_java())
7070

7171
arch = stdlib.cpu_arch();
72-
tc.verifyGreaterThan(strlength(arch), 0)
72+
tc.verifyGreaterThan(strlength(arch), 0, "CPU architecture should not be empty")
7373
end
7474

7575
function test_ram_total(tc)

0 commit comments

Comments
 (0)