types.h (942B)
1 #pragma once 2 3 #include <cstdint> 4 5 #include "dsp56kEmu/buildconfig.h" 6 7 namespace bridgeLib 8 { 9 static constexpr uint32_t g_udpServerPort = 56303; 10 static constexpr uint32_t g_tcpServerPort = 56362; 11 12 static constexpr uint32_t g_protocolVersion = 1'00'03; 13 14 using SessionId = uint64_t; 15 16 enum class Platform 17 { 18 Windows, 19 MacOS, 20 Unix 21 }; 22 23 enum class Arch 24 { 25 X86, 26 X64, 27 Aarch64 28 }; 29 30 #ifdef _WIN32 31 static constexpr Platform g_platform = Platform::Windows; 32 #elif defined(__APPLE__) 33 static constexpr Platform g_platform = Platform::MacOS; 34 #elif defined(__linux__) || defined(__unix__) 35 static constexpr Platform g_platform = Platform::Unix; 36 #endif 37 38 #ifdef HAVE_ARM64 39 static constexpr Arch g_arch = Arch::Aarch64; 40 #elif defined(HAVE_X86_64) 41 static constexpr Arch g_arch = Arch::X64; 42 #elif defined(_M_IX86) || defined(__i386__) 43 static constexpr Arch g_arch = Arch::X86; 44 #else 45 static_assert(false, "Unknown architecture"); 46 #endif 47 }