Patchwork fbdev: fix pixman compile on old pixman

login
register
mail settings
Submitter Alexander Graf
Date Nov. 26, 2012, 6:52 p.m.
Message ID <1353955943-26536-1-git-send-email-agraf@suse.de>
Download mbox | patch
Permalink /patch/202005/
State New
Headers show

Comments

Alexander Graf - Nov. 26, 2012, 6:52 p.m.
My QEMU compile failed with the following error:

qemu-pixman.c: In function ‘qemu_pixman_get_type’:
qemu-pixman.c:24: error: ‘PIXMAN_TYPE_BGRA’ undeclared (first use in this function)
qemu-pixman.c:24: error: (Each undeclared identifier is reported only once
qemu-pixman.c:24: error: for each function it appears in.)

Guard the PIXMAN_TYPE_BGRA branch like in the case right above the failing
case, so that compilation is fixed. Functionality on such old pixman is a
different question ;-).

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 qemu-pixman.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
Gerd Hoffmann - Nov. 26, 2012, 8:04 p.m.
Hi,

> Guard the PIXMAN_TYPE_BGRA branch like in the case right above the failing
> case, so that compilation is fixed. Functionality on such old pixman is a
> different question ;-).

> +#if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0, 21, 8)
>              type = PIXMAN_TYPE_BGRA;
> +#endif

Version is wrong, on 0.18.4 this builds just fine, so PIXMAN_TYPE_BGRA
must be older than that.

I'd also tend to just change the check in configure instead and ignore
system pixman in case it is too old.

cheers,
  Gerd
Alexander Graf - Nov. 26, 2012, 8:09 p.m.
On 26.11.2012, at 21:04, Gerd Hoffmann wrote:

>  Hi,
> 
>> Guard the PIXMAN_TYPE_BGRA branch like in the case right above the failing
>> case, so that compilation is fixed. Functionality on such old pixman is a
>> different question ;-).
> 
>> +#if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0, 21, 8)
>>             type = PIXMAN_TYPE_BGRA;
>> +#endif
> 
> Version is wrong, on 0.18.4 this builds just fine, so PIXMAN_TYPE_BGRA
> must be older than that.
> 
> I'd also tend to just change the check in configure instead and ignore
> system pixman in case it is too old.

Ah, I just copied the check from 5 lines above :).


Alex

Patch

diff --git a/qemu-pixman.c b/qemu-pixman.c
index ac7bc01..e46e180 100644
--- a/qemu-pixman.c
+++ b/qemu-pixman.c
@@ -21,7 +21,9 @@  int qemu_pixman_get_type(int rshift, int gshift, int bshift)
         if (rshift == 0) {
             type = PIXMAN_TYPE_ABGR;
         } else {
+#if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0, 21, 8)
             type = PIXMAN_TYPE_BGRA;
+#endif
         }
     }
     return type;