VirtualBox

Changeset 101176 in vbox for trunk/src


Ignore:
Timestamp:
Sep 19, 2023 4:57:28 PM (15 months ago)
Author:
vboxsync
Message:

Main: Added a new static function Host::s_getPlatformArchitecture() for easier retrieving the host's platform architecture internally. bugref:10384

Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/HostImpl.h

    r101035 r101176  
    9999
    100100    static void i_generateMACAddress(Utf8Str &mac);
     101    static PlatformArchitecture_T s_getPlatformArchitecture();
    101102
    102103#ifdef RT_OS_WINDOWS
  • trunk/src/VBox/Main/src-server/HostImpl.cpp

    r101035 r101176  
    601601HRESULT Host::getArchitecture(PlatformArchitecture_T *platformArchitecture)
    602602{
    603 #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
    604     *platformArchitecture = PlatformArchitecture_x86;
    605 #elif defined(RT_ARCH_ARM64) || defined(RT_ARCH_ARM32)
    606     *platformArchitecture = PlatformArchitecture_ARM;
    607 #else
    608 # error "Port me!"
    609 #endif
     603    *platformArchitecture = Host::s_getPlatformArchitecture();
    610604
    611605    return S_OK;
     
    39633957}
    39643958
     3959/**
     3960 * Returns the host's platform architecture.
     3961 *
     3962 * @returns The host's platform architecture.
     3963 */
     3964/* static */
     3965PlatformArchitecture_T Host::s_getPlatformArchitecture()
     3966{
     3967#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
     3968    return PlatformArchitecture_x86;
     3969#elif defined(RT_ARCH_ARM64) || defined(RT_ARCH_ARM32)
     3970    return PlatformArchitecture_ARM;
     3971#else
     3972# error "Port me!"
     3973    return PlatformArchitecture_None;
     3974#endif
     3975}
     3976
    39653977#ifdef RT_OS_WINDOWS
    39663978HRESULT Host::i_getFixedDrivesFromGlobalNamespace(std::list<std::pair<com::Utf8Str, com::Utf8Str> > &aDriveList) RT_NOEXCEPT
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette