VirtualBox

Changeset 6568 in vbox


Ignore:
Timestamp:
Jan 29, 2008 3:03:34 PM (17 years ago)
Author:
vboxsync
Message:

Additions/X11: attempt to fix the XFree86 additions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3Lib.cpp

    r6556 r6568  
    3434#include <iprt/asm.h>
    3535#include <iprt/string.h>
    36 #ifdef VBOX_VBGLR3_XFREE86
    37 /* Definitions for X server library functions such as xf86open and mappings to C functions. */
    38 /* Make the headers C++-compatible */
    39 # define class xf86_vbox_class
    40 # define bool xf86_vbox_bool
    41 # define private xf86_vbox_private
    42 # define new xf86_vbox_new
    43 extern "C"
    44 {
    45 # include "xf86.h"
    46 # include "xf86_OSproc.h"
    47 # include "xf86Resources.h"
    48 # include "xf86_ansic.h"
    49 }
    50 # undef class
    51 # undef bool
    52 # undef private
    53 # undef new
    54 #else
    55 # include <iprt/file.h>
    56 # include <iprt/assert.h>
    57 # include <iprt/thread.h>
    58 #endif
     36#include <iprt/file.h>
     37#include <iprt/assert.h>
     38#include <iprt/thread.h>
    5939#include <VBox/VBoxGuest.h>
    6040#include "VBGLR3Internal.h"
    6141
     42#ifdef VBOX_VBGLR3_XFREE86
     43/* Rather than try to resolve all the header file conflicts, I will just
     44   prototype what we need here. */
     45# define XF86_O_RDWR  0x0002
     46typedef void *pointer;
     47extern int xf86open(const char*, int,...);
     48extern int xf86close(int);
     49extern int xf86ioctl(int, unsigned long, pointer);
     50#endif
    6251
    6352/*******************************************************************************
     
    158147
    159148#elif defined(VBOX_VBGLR3_XFREE86)
    160     int File = open(VBOXGUEST_DEVICE_NAME, O_RDWR);
     149    int File = xf86open(VBOXGUEST_DEVICE_NAME, XF86_O_RDWR);
    161150    if (File == -1)
    162151        return VERR_OPEN_FAILED;
     
    200189
    201190#elif defined(VBOX_VBGLR3_XFREE86)
    202     close(File);
     191    xf86close(File);
    203192    File = -1;
    204193
     
    255244    /* PORTME - This is preferred over the RTFileIOCtl variant below, just be careful with the (int). */
    256245/** @todo test status code passing! */
    257     int rc = ioctl(g_File, (int)iFunction, pvData);
     246    int rc = xf86ioctl(g_File, iFunction, pvData);
    258247    if (rc == -1)
    259     {
    260         rc = errno;
    261         return RTErrConvertFromErrno(rc);
    262     }
     248        return VERR_FILE_IO_ERROR;  /* This is purely legacy stuff, it has to work and no more. */
    263249    return VINF_SUCCESS;
    264250
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