VirtualBox

Changeset 92621 in vbox for trunk/src/VBox/Additions/common


Ignore:
Timestamp:
Nov 29, 2021 10:05:23 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
148513
Message:

VBoxGuest/darwin,IPRT/r0drv/darwin: Clang 13 build fixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-darwin.cpp

    r85124 r92621  
    6262#include <sys/proc.h>
    6363#include <sys/kauth.h>
     64#define _OS_OSUNSERIALIZE_H /* HACK ALERT! Block importing OSUnserialized.h as it causes compilation trouble with
     65                               newer clang versions and the 10.15 SDK, and we really don't need it. Sample error:
     66                               libkern/c++/OSUnserialize.h:72:2: error: use of OSPtr outside of a return type [-Werror,-Wossharedptr-misuse] */
    6467#include <IOKit/IOService.h>
    6568#include <IOKit/IOUserClient.h>
     
    8689                                            proc_selfname(a_Name, VBOX_PROC_SELFNAME_LEN)
    8790/** @} */
     91
     92#ifndef minor
     93/* The inlined C++ function version minor() takes the wrong parameter
     94   type, uint32_t instead of dev_t.  This kludge works around that. */
     95# define minor(x) minor((uint32_t)(x))
     96#endif
    8897
    8998
     
    313322        {
    314323            /** @todo limit /dev/vboxguest access. */
    315             g_hDevFsDeviceSys = devfs_make_node(makedev(g_iMajorDeviceNo, 0), DEVFS_CHAR,
     324            g_hDevFsDeviceSys = devfs_make_node(makedev((uint32_t)g_iMajorDeviceNo, 0), DEVFS_CHAR,
    316325                                                UID_ROOT, GID_WHEEL, 0666, DEVICE_NAME_SYS);
    317326            if (g_hDevFsDeviceSys != NULL)
     
    320329                 * And a all-user device.
    321330                 */
    322                 g_hDevFsDeviceUsr = devfs_make_node(makedev(g_iMajorDeviceNo, 1), DEVFS_CHAR,
     331                g_hDevFsDeviceUsr = devfs_make_node(makedev((uint32_t)g_iMajorDeviceNo, 1), DEVFS_CHAR,
    323332                                                    UID_ROOT, GID_WHEEL, 0666, DEVICE_NAME_USR);
    324333                if (g_hDevFsDeviceUsr != NULL)
     
    499508    RT_NOREF(Dev, fFlags);
    500509    const bool          fUnrestricted = minor(Dev) == 0;
    501     const RTPROCESS     Process = proc_pid(pProcess);
     510    const RTPROCESS     Process = (RTPROCESS)proc_pid(pProcess);
    502511    const unsigned      iHash = SESSION_HASH(Process);
    503512    PVBOXGUESTSESSION   pSession;
     
    897906                            {
    898907                                pvMMIOBase = (void *)m_pMap->getVirtualAddress();
    899                                 cbMMIO     = m_pMap->getLength();
     908                                cbMMIO     = (uint32_t)m_pMap->getLength();
    900909                            }
    901910
Note: See TracChangeset for help on using the changeset viewer.

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