MCPcopy Create free account
hub / github.com/aseprite/laf / app_main

Function app_main

examples/show_platform.cpp:11–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9#include <cstdio>
10
11int app_main(int argc, char* argv[])
12{
13 base::Platform p = base::get_platform();
14 switch (p.os) {
15#if LAF_WINDOWS
16 case base::Platform::OS::Windows:
17 std::printf("Windows v%s%s%s",
18 p.osVer.str().c_str(),
19 p.isWow64 ? " WoW64" : "",
20 (p.wineVer ? (std::string(" WINE v") + p.wineVer).c_str() : ""));
21 break;
22#endif
23 case base::Platform::OS::macOS: std::printf("macOS v%s", p.osVer.str().c_str()); break;
24#if LAF_LINUX
25 case base::Platform::OS::Linux:
26 std::printf("Linux %s", p.distroName.c_str());
27 if (!p.distroVer.empty())
28 std::printf(" %s", p.distroVer.c_str());
29 break;
30#endif
31 }
32 switch (p.arch) {
33 case base::Platform::Arch::x86: std::printf(" (x86)"); break;
34 case base::Platform::Arch::x64: std::printf(" (x64)"); break;
35 case base::Platform::Arch::arm64: std::printf(" (arm64)"); break;
36 case base::Platform::Arch::riscv64: std::printf(" (riscv64)"); break;
37 }
38 std::printf("\n");
39 return 0;
40}

Callers

nothing calls this directly

Calls 3

get_platformFunction · 0.85
strMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected