| 726 | } |
| 727 | |
| 728 | String PreferencesCache::GetDeviceID() |
| 729 | { |
| 730 | #if defined(DEATH_TARGET_X86) |
| 731 | std::int32_t arch = 1; |
| 732 | Cpu::Features cpuFeatures = Cpu::runtimeFeatures(); |
| 733 | if (cpuFeatures & Cpu::Avx) { |
| 734 | arch |= 0x400; |
| 735 | } |
| 736 | if (cpuFeatures & Cpu::Avx2) { |
| 737 | arch |= 0x800; |
| 738 | } |
| 739 | if (cpuFeatures & Cpu::Avx512f) { |
| 740 | arch |= 0x1000; |
| 741 | } |
| 742 | #elif defined(DEATH_TARGET_ARM) |
| 743 | std::int32_t arch = 2; |
| 744 | Cpu::Features cpuFeatures = Cpu::runtimeFeatures(); |
| 745 | if (cpuFeatures & Cpu::Neon) { |
| 746 | arch |= 0x2000; |
| 747 | } |
| 748 | #elif defined(DEATH_TARGET_POWERPC) |
| 749 | std::int32_t arch = 3; |
| 750 | #elif defined(DEATH_TARGET_RISCV) |
| 751 | std::int32_t arch = 5; |
| 752 | #elif defined(DEATH_TARGET_WASM) |
| 753 | std::int32_t arch = 4; |
| 754 | Cpu::Features cpuFeatures = Cpu::runtimeFeatures(); |
| 755 | if (cpuFeatures & Cpu::Simd128) { |
| 756 | arch |= 0x4000; |
| 757 | } |
| 758 | #else |
| 759 | std::int32_t arch = 0; |
| 760 | #endif |
| 761 | #if defined(DEATH_TARGET_32BIT) |
| 762 | arch |= 0x100; |
| 763 | #endif |
| 764 | #if defined(DEATH_TARGET_BIG_ENDIAN) |
| 765 | arch |= 0x200; |
| 766 | #endif |
| 767 | #if defined(DEATH_TARGET_CYGWIN) |
| 768 | arch |= 0x200000; |
| 769 | #endif |
| 770 | #if defined(DEATH_TARGET_MINGW) |
| 771 | arch |= 0x400000; |
| 772 | #endif |
| 773 | |
| 774 | #if defined(DEATH_TARGET_ANDROID) |
| 775 | auto sanitizeName = [](char* dst, std::size_t dstMaxLength, std::size_t& dstLength, StringView name, bool isBrand) { |
| 776 | bool wasSpace = true; |
| 777 | std::size_t lowercaseLength = 0; |
| 778 | |
| 779 | if (isBrand) { |
| 780 | for (char c : name) { |
| 781 | if (c == '\0' || c == ' ') { |
| 782 | break; |
| 783 | } |
| 784 | lowercaseLength++; |
| 785 | } |
nothing calls this directly
no test coverage detected