Hi Michael and virtualbox developers


I found the (proper)  solution for this problem.

First *thanks* Michael for giving me the correct hint with the "filter-out" 
patch (that part is from you, so is released as your preferred license).

The problem is a bad number in the define, it was driving me crazy, I didn't 
look carefully at the number, and being <10 gave me a bad hint about the number 
of the preceding zeros.

let me explain.

steps to reproduce:

download from [1] or wherever you prefer various xorg releases, I downloaded 
2:1.9.5-1 the version similar to the one giving the error number.

download xserver-xorg-dev 2:1.9.5-1 the package containing the version 
definition.

open it and copy-paste on a calculator:
(((1) * 10000000) + ((9) * 100000) + ((5) * 1000) + 0) = 10905000


compare with 1.16
(((1) * 10000000) + ((16) * 100000) + ((0) * 1000) + 0) = 11600000


and 1.17 is the same :)



now let's look at the problematic code:

/** Helper to work round different ways of getting the root window in different
* server versions. */
#if defined(XORG_VERSION_CURRENT) && XORG_VERSION_CURRENT < 700000000 \
 && XORG_VERSION_CURRENT >= 100900000
# define ROOT_WINDOW(pScrn) screenInfo.screens[(pScrn)->scrnIndex]->root
#else
# define ROOT_WINDOW(pScrn) WindowTable[(pScrn)->scrnIndex]


yes, the number 100900000 is wrong.

it should be 10900000


TLTR;
the number is wrong.
s/100900000/10900000

do you want to know something funny?
the previous patch was working because I did copy-paste from Makefile.kmk your 
*bad* numbers!!!

LOL

Also the 7.0 series is wrong(((7) * 10000000) + ((0) * 100000) + ((0) * 1000) + 
0)

I'm attaching the MIT released patch, 

with all the numbers corrected.

the patch is also available here, on the debian git
http://anonscm.debian.org/cgit/pkg-virtualbox/virtualbox.git/commit/?id=bd4c359cb480a182dbb0fd87dcad4a79cb6af130

[1] http://snapshot.debian.org/package/xorg-server/


have a nice weekend,

cheers,

Gianfranco
diff --git a/src/VBox/Additions/x11/vboxvideo/Makefile.kmk b/src/VBox/Additions/x11/vboxvideo/Makefile.kmk
index 592d65e..6cdf46b 100644
--- a/src/VBox/Additions/x11/vboxvideo/Makefile.kmk
+++ b/src/VBox/Additions/x11/vboxvideo/Makefile.kmk
@@ -130,7 +130,7 @@ vboxvideo_drv_SOURCES = \
 #
 DLLS += vboxvideo_drv_70
 vboxvideo_drv_70_TEMPLATE = VBOXGUESTR3XORGMOD
-vboxvideo_drv_70_DEFS = $(vboxvideo_70_DEFS) XORG_VERSION_CURRENT=700000000
+vboxvideo_drv_70_DEFS = $(vboxvideo_70_DEFS) XORG_VERSION_CURRENT=70000000
 ifeq ($(KBUILD_TARGET),solaris) # don't use .solaris or anything here.
  vboxvideo_drv_70_CFLAGS += -D_XPG6 -Wno-shadow # Use XPG6 until we have moved the C++ bits into a library.
 endif
@@ -147,7 +147,7 @@ vboxvideo_drv_70_SOURCES  = $(vboxvideo_drv_SOURCES)
 DLLS += vboxvideo_drv_71
 vboxvideo_drv_71_TEMPLATE = VBOXGUESTR3XORGMOD
 vboxvideo_drv_71_CFLAGS := $(vboxvideo_drv_70_CFLAGS)
-vboxvideo_drv_71_DEFS := $(vboxvideo_70_DEFS) XORG_VERSION_CURRENT=700100000
+vboxvideo_drv_71_DEFS := $(vboxvideo_70_DEFS) XORG_VERSION_CURRENT=70100000
 vboxvideo_drv_71_INCS = \
 	$(vboxvideo_xorg_INCS) \
 	$(VBOX_PATH_X11_ROOT)/xorg-server-1.1.0
@@ -161,7 +161,7 @@ vboxvideo_drv_71_SOURCES  = $(vboxvideo_drv_SOURCES)
 DLLS += vboxvideo_drv_13
 vboxvideo_drv_13_TEMPLATE = VBOXGUESTR3XORGMOD
 vboxvideo_drv_13_CFLAGS := $(vboxvideo_drv_70_CFLAGS)
-vboxvideo_drv_13_DEFS := $(vboxvideo_13_DEFS) XORG_VERSION_CURRENT=100300000
+vboxvideo_drv_13_DEFS := $(vboxvideo_13_DEFS) XORG_VERSION_CURRENT=10300000
 vboxvideo_drv_13_INCS = \
 	$(vboxvideo_xorg_INCS) \
 	$(VBOX_PATH_X11_ROOT)/xorg-server-1.3.0.0
@@ -175,7 +175,7 @@ vboxvideo_drv_13_SOURCES = $(vboxvideo_drv_SOURCES) edid.c
 DLLS += vboxvideo_drv_14
 vboxvideo_drv_14_TEMPLATE = VBOXGUESTR3XORGMOD
 vboxvideo_drv_14_CFLAGS := $(vboxvideo_drv_70_CFLAGS)
-vboxvideo_drv_14_DEFS := $(vboxvideo_13_DEFS) XORG_VERSION_CURRENT=100400000
+vboxvideo_drv_14_DEFS := $(vboxvideo_13_DEFS) XORG_VERSION_CURRENT=10400000
 vboxvideo_drv_14_INCS = \
 	$(vboxvideo_xorg_INCS) \
 	$(VBOX_PATH_X11_ROOT)/xorg-server-1.4.2
@@ -189,7 +189,7 @@ vboxvideo_drv_14_SOURCES  = $(vboxvideo_drv_13_SOURCES)
 DLLS += vboxvideo_drv_15
 vboxvideo_drv_15_TEMPLATE = VBOXGUESTR3XORGMOD
 vboxvideo_drv_15_CFLAGS := $(vboxvideo_drv_70_CFLAGS)
-vboxvideo_drv_15_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=100503000
+vboxvideo_drv_15_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=10503000
 if1of ($(KBUILD_TARGET), linux solaris)
  vboxvideo_drv_15_DEFS += \
  	VBOX_DRI_OLD
@@ -211,7 +211,7 @@ endif
 DLLS += vboxvideo_drv_16
 vboxvideo_drv_16_TEMPLATE = VBOXGUESTR3XORGMOD
 vboxvideo_drv_16_CFLAGS := $(vboxvideo_drv_70_CFLAGS)
-vboxvideo_drv_16_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=100600000
+vboxvideo_drv_16_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=10600000
 if1of ($(KBUILD_TARGET), linux solaris)
  vboxvideo_drv_16_DEFS += \
  	VBOX_DRI_OLD
@@ -229,7 +229,7 @@ vboxvideo_drv_16_SOURCES := $(vboxvideo_drv_15_SOURCES)
 DLLS += vboxvideo_drv_17
 vboxvideo_drv_17_TEMPLATE = VBOXGUESTR3XORGMOD
 vboxvideo_drv_17_CFLAGS := $(vboxvideo_drv_70_CFLAGS)
-vboxvideo_drv_17_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=100699000
+vboxvideo_drv_17_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=10699000
 vboxvideo_drv_17_INCS = \
 	$(vboxvideo_xorg_INCS) \
 	$(VBOX_PATH_X11_ROOT)/xorg-server-1.7.7
@@ -247,7 +247,7 @@ endif
 DLLS += vboxvideo_drv_18
 vboxvideo_drv_18_TEMPLATE = VBOXGUESTR3XORGMOD
 vboxvideo_drv_18_CFLAGS := $(vboxvideo_drv_70_CFLAGS)
-vboxvideo_drv_18_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=100800000
+vboxvideo_drv_18_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=10800000
 vboxvideo_drv_18_INCS = \
 	$(vboxvideo_xorg_INCS) \
 	$(VBOX_PATH_X11_ROOT)/xorg-server-1.8.0
@@ -261,7 +261,7 @@ vboxvideo_drv_18_SOURCES := $(vboxvideo_drv_17_SOURCES)
 DLLS += vboxvideo_drv_19
 vboxvideo_drv_19_TEMPLATE = VBOXGUESTR3XORGMOD
 vboxvideo_drv_19_CFLAGS := $(vboxvideo_drv_70_CFLAGS)
-vboxvideo_drv_19_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=100900000
+vboxvideo_drv_19_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=10900000
 vboxvideo_drv_19_INCS = \
 	$(vboxvideo_xorg_INCS) \
 	$(VBOX_PATH_X11_ROOT)/xorg-server-1.9.0
@@ -275,7 +275,7 @@ vboxvideo_drv_19_SOURCES := $(vboxvideo_drv_17_SOURCES)
 DLLS += vboxvideo_drv_110
 vboxvideo_drv_110_TEMPLATE = VBOXGUESTR3XORGMOD
 vboxvideo_drv_110_CFLAGS := $(vboxvideo_drv_70_CFLAGS)
-vboxvideo_drv_110_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=101000000
+vboxvideo_drv_110_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=11000000
 vboxvideo_drv_110_INCS = \
 	$(vboxvideo_xorg_INCS) \
 	$(VBOX_PATH_X11_ROOT)/xorg-server-1.10.0
@@ -289,7 +289,7 @@ vboxvideo_drv_110_SOURCES := $(vboxvideo_drv_17_SOURCES)
 DLLS += vboxvideo_drv_111
 vboxvideo_drv_111_TEMPLATE = VBOXGUESTR3XORGMOD
 vboxvideo_drv_111_CFLAGS := $(vboxvideo_drv_70_CFLAGS)
-vboxvideo_drv_111_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=101100000
+vboxvideo_drv_111_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=11100000
 vboxvideo_drv_111_INCS = \
 	$(vboxvideo_xorg_INCS) \
 	$(VBOX_PATH_X11_ROOT)/xorg-server-1.11.0
@@ -303,7 +303,7 @@ vboxvideo_drv_111_SOURCES := $(vboxvideo_drv_17_SOURCES)
 DLLS += vboxvideo_drv_112
 vboxvideo_drv_112_TEMPLATE = VBOXGUESTR3XORGMOD
 vboxvideo_drv_112_CFLAGS := $(vboxvideo_drv_70_CFLAGS)
-vboxvideo_drv_112_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=101200000
+vboxvideo_drv_112_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=11200000
 vboxvideo_drv_112_INCS = \
 	$(vboxvideo_xorg_INCS) \
 	$(VBOX_PATH_X11_ROOT)/xorg-server-1.12.0
@@ -317,7 +317,7 @@ vboxvideo_drv_112_SOURCES := $(vboxvideo_drv_17_SOURCES)
 DLLS += vboxvideo_drv_113
 vboxvideo_drv_113_TEMPLATE = VBOXGUESTR3XORGMOD
 vboxvideo_drv_113_CFLAGS := $(vboxvideo_drv_70_CFLAGS)
-vboxvideo_drv_113_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=101300000
+vboxvideo_drv_113_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=11300000
 vboxvideo_drv_113_INCS = \
 	$(vboxvideo_xorg_INCS) \
 	$(VBOX_PATH_X11_ROOT)/xorg-server-1.13.0
@@ -331,7 +331,7 @@ vboxvideo_drv_113_SOURCES := $(vboxvideo_drv_17_SOURCES)
 DLLS += vboxvideo_drv_114
 vboxvideo_drv_114_TEMPLATE = VBOXGUESTR3XORGMOD
 vboxvideo_drv_114_CFLAGS := $(vboxvideo_drv_70_CFLAGS)
-vboxvideo_drv_114_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=101400000
+vboxvideo_drv_114_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=11400000
 vboxvideo_drv_114_INCS = \
 	$(vboxvideo_xorg_INCS) \
 	$(VBOX_PATH_X11_ROOT)/xorg-server-1.14.0
@@ -345,7 +345,7 @@ vboxvideo_drv_114_SOURCES := $(vboxvideo_drv_17_SOURCES)
 DLLS += vboxvideo_drv_115
 vboxvideo_drv_115_TEMPLATE = VBOXGUESTR3XORGMOD
 vboxvideo_drv_115_CFLAGS := $(vboxvideo_drv_70_CFLAGS)
-vboxvideo_drv_115_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=101500000
+vboxvideo_drv_115_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=11500000
 vboxvideo_drv_115_INCS = \
 	$(vboxvideo_xorg_INCS) \
 	$(VBOX_PATH_X11_ROOT)/xorg-server-1.15.0
@@ -359,7 +359,7 @@ vboxvideo_drv_115_SOURCES := $(vboxvideo_drv_17_SOURCES)
 DLLS += vboxvideo_drv_116
 vboxvideo_drv_116_TEMPLATE = VBOXGUESTR3XORGMOD
 vboxvideo_drv_116_CFLAGS := $(vboxvideo_drv_70_CFLAGS)
-vboxvideo_drv_116_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=101600000
+vboxvideo_drv_116_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=11600000
 vboxvideo_drv_116_INCS = \
 	$(vboxvideo_xorg_INCS) \
 	$(VBOX_PATH_X11_ROOT)/xorg-server-1.16.0
@@ -373,7 +373,7 @@ vboxvideo_drv_116_SOURCES := $(vboxvideo_drv_17_SOURCES)
 DLLS += vboxvideo_drv_117
 vboxvideo_drv_117_TEMPLATE = VBOXGUESTR3XORGMOD
 vboxvideo_drv_117_CFLAGS := $(vboxvideo_drv_70_CFLAGS)
-vboxvideo_drv_117_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=101700000
+vboxvideo_drv_117_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=11700000
 vboxvideo_drv_117_INCS = \
 	$(vboxvideo_xorg_INCS) \
 	$(VBOX_PATH_X11_ROOT)/xorg-server-1.17.1
@@ -388,7 +388,7 @@ ifdef VBOX_USE_SYSTEM_XORG_HEADERS
  vboxvideo_drv_system_TEMPLATE = VBOXGUESTR3XORGMOD
  vboxvideo_drv_system_CFLAGS := \
         $(vboxvideo_drv_70_CFLAGS) -include xorg-server.h
- vboxvideo_drv_system_DEFS := $(vboxvideo_15_DEFS)
+ vboxvideo_drv_system_DEFS := $(filter-out _XORG_SERVER_H_ _DIX_CONFIG_H_, $(vboxvideo_15_DEFS))
  vboxvideo_drv_system_INCS += \
         $(PATH_ROOT)/src/VBox/Runtime/include \
         /usr/include/x11 \
diff --git a/src/VBox/Additions/x11/vboxvideo/vboxvideo.h b/src/VBox/Additions/x11/vboxvideo/vboxvideo.h
index 381479c..29ff888 100644
--- a/src/VBox/Additions/x11/vboxvideo/vboxvideo.h
+++ b/src/VBox/Additions/x11/vboxvideo/vboxvideo.h
@@ -133,8 +133,8 @@ extern void GlxSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs,
 
 /** Helper to work round different ways of getting the root window in different
  * server versions. */
-#if defined(XORG_VERSION_CURRENT) && XORG_VERSION_CURRENT < 700000000 \
-    && XORG_VERSION_CURRENT >= 100900000
+#if defined(XORG_VERSION_CURRENT) && XORG_VERSION_CURRENT < 70000000 \
+    && XORG_VERSION_CURRENT >= 10900000
 # define ROOT_WINDOW(pScrn) screenInfo.screens[(pScrn)->scrnIndex]->root
 #else
 # define ROOT_WINDOW(pScrn) WindowTable[(pScrn)->scrnIndex]
_______________________________________________
vbox-dev mailing list
[email protected]
https://www.virtualbox.org/mailman/listinfo/vbox-dev

Reply via email to