VirtualBox

Ignore:
Timestamp:
Jan 12, 2015 9:10:36 AM (10 years ago)
Author:
vboxsync
Message:

Additions/x11/vboxvideo: better separate VBox-specific and X server-specific code.

Location:
trunk/src/VBox/Additions/x11/vboxvideo
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/x11/vboxvideo/Makefile.kmk

    r53570 r53770  
    103103vboxvideo_drv_SOURCES = \
    104104        getmode.c \
     105        helpers.c \
    105106        pointer.c \
    106107        setmode.c \
  • trunk/src/VBox/Additions/x11/vboxvideo/getmode.c

    r53624 r53770  
    141141    unsigned i;
    142142
    143     XF86ASSERT(cIndex < vboxNumStdModes,
     143    VBVXASSERT(cIndex < vboxNumStdModes,
    144144               ("cIndex = %d, vboxNumStdModes = %d\n", cIndex,
    145145                vboxNumStdModes));
  • trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.h

    r53544 r53770  
    5858#ifdef DEBUG
    5959
    60 #include <xf86.h>
    61 
    6260#define TRACE_ENTRY() \
    6361do { \
    64     xf86Msg(X_INFO, __PRETTY_FUNCTION__); \
    65     xf86Msg(X_INFO, ": entering\n"); \
     62    vbvxMsg(__PRETTY_FUNCTION__); \
     63    vbvxMsg(": entering\n"); \
    6664} while(0)
    6765#define TRACE_EXIT() \
    6866do { \
    69     xf86Msg(X_INFO, __PRETTY_FUNCTION__); \
    70     xf86Msg(X_INFO, ": leaving\n"); \
     67    vbvxMsg(__PRETTY_FUNCTION__); \
     68    vbvxMsg(": leaving\n"); \
    7169} while(0)
    7270#define TRACE_LOG(...) \
    7371do { \
    74     xf86Msg(X_INFO, __PRETTY_FUNCTION__); \
    75     xf86Msg(X_INFO, __VA_ARGS__); \
     72    vbvxMsg("%s: ", __PRETTY_FUNCTION__); \
     73    vbvxMsg(__VA_ARGS__); \
    7674} while(0)
    7775# define TRACE_LINE() do \
    7876{ \
    79     ErrorF ("%s: line %d\n", __FUNCTION__, __LINE__); \
    80     } while(0)
    81 # define XF86ASSERT(expr, out) \
    82 if (!(expr)) \
    83 { \
    84     ErrorF ("\nAssertion failed!\n\n"); \
    85     ErrorF ("%s\n", #expr); \
    86     ErrorF ("at %s (%s:%d)\n", __PRETTY_FUNCTION__, __FILE__, __LINE__); \
    87     ErrorF out; \
    88     FatalError("Aborting"); \
    89 }
     77    vbvxMsg("%s: line %d\n", __FUNCTION__, __LINE__); \
     78} while(0)
    9079#else  /* !DEBUG */
    9180
     
    9382#define TRACE_EXIT()          do { } while (0)
    9483#define TRACE_LOG(...)        do { } while (0)
    95 #define XF86ASSERT(expr, out) do { } while (0)
    9684
    9785#endif  /* !DEBUG */
     86
     87/* Not just for debug builds.  If something is wrong we want to know at once. */
     88#define VBVXASSERT(expr, out) \
     89if (!(expr)) \
     90{ \
     91    vbvxMsg("\nAssertion failed!\n\n"); \
     92    vbvxMsg("%s\n", #expr); \
     93    vbvxMsg("at %s (%s:%d)\n", __PRETTY_FUNCTION__, __FILE__, __LINE__); \
     94    vbvxMsg out; \
     95    vbvxAbortServer(); \
     96}
    9897
    9998#define BOOL_STR(a) ((a) ? "TRUE" : "FALSE")
     
    234233} VBOXRec, *VBOXPtr;
    235234
     235/* helpers.c */
     236extern void vbvxMsg(const char *pszFormat, ...);
     237extern void vbvxMsgV(const char *pszFormat, va_list args);
     238extern void vbvxAbortServer(void);
     239
     240/* setmode.c */
    236241extern Bool vbox_init(int scrnIndex, VBOXPtr pVBox);
    237242extern Bool vbox_cursor_init (ScreenPtr pScreen);
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