[vbox-dev] I: Fix build failure when VBOX_USE_SYSTEM_XORG_HEADERS is defined.

Gianfranco Costamagna costamagnagianfranco at yahoo.it
Sat Feb 14 13:38:33 GMT 2015


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 37-fix-build.patch
Type: text/x-diff
Size: 9213 bytes
Desc: not available
URL: <http://www.virtualbox.org/pipermail/vbox-dev/attachments/20150214/5ece74a7/attachment.bin>


More information about the vbox-dev mailing list