Bug 23260

Summary: blitters-test doesn't work on win32
Product: pixman Reporter: Sam Thursfield <ssssam>
Component: pixmanAssignee: Søren Sandmann Pedersen <soren.sandmann>
Status: RESOLVED FIXED QA Contact: Søren Sandmann Pedersen <soren.sandmann>
Severity: normal    
Priority: medium    
Version: git master   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: disable blitters-test if memalign is not present
A patch

Description Sam Thursfield 2009-08-11 17:49:39 UTC
Created attachment 28526 [details] [review]
disable blitters-test if memalign is not present

Hello!
The new blitters-test breaks my compile under MSYS/mingw, because they don't really have memalign.

I wrote patch to conditionally build the test only if memalign is detected.
Comment 1 Søren Sandmann Pedersen 2009-08-12 08:23:45 UTC
Thanks for the bug report.

Does MSYS/mingw have posix_memalign()? Ie., does this work:

   #include <stdlib.h>

   int main ()
   { 
       void *p;

       posix_memalign (&p, 16, 2343);
   }

?
Comment 2 Sam Thursfield 2009-08-12 08:40:23 UTC
(In reply to comment #1)
> Thanks for the bug report.
> 
> Does MSYS/mingw have posix_memalign()? Ie., does this work:
> 
>    #include <stdlib.h>
> 
>    int main ()
>    { 
>        void *p;
> 
>        posix_memalign (&p, 16, 2343);
>    }
> 
> ?
> 

It's not got that either - grep -r "memalloc" mingw/include doesn't find anything :(

There is something called _aligned_malloc or some such inside MSVCRT70.DLL and higher, which I assume would make the test work - although that's not technically a system DLL, it's on most Windows systems. I didn't feel like messing around trying to make that work ..
Comment 3 Søren Sandmann Pedersen 2009-08-12 11:13:47 UTC
Created attachment 28556 [details] [review]
A patch

Here is a patch that uses posix_memalign(), but falls back to malloc() if that is not available.

If you can test it on mingw, I'd appreciated it.

Thanks,
Comment 4 Søren Sandmann Pedersen 2009-08-12 14:57:24 UTC
At:

    http://www.freedesktop.org/~sandmann/pixman-0.15.21.tar.gz

is a tarball with that patch applied.

Comment 5 Sam Thursfield 2009-08-12 17:14:58 UTC
(In reply to comment #3)
> Created an attachment (id=28556) [details]
> A patch
> 
> Here is a patch that uses posix_memalign(), but falls back to malloc() if that
> is not available.
> 
> If you can test it on mingw, I'd appreciated it.

The test compiles and succeeds.
Thanks for looking at this so quickly!
sam

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.