pixman: Branch 'master'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Mar 14 23:40:00 UTC 2020


 pixman/pixman-compiler.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3344f507dd4483643a4f238ea303ba49fc8469fc
Author: Antonio Ospite <ao2 at ao2.it>
Date:   Sat Mar 14 23:53:39 2020 +0100

    pixman-compiler.h: fix building tests with MinGW
    
    MinGW supports __declspec(dllexport) but the current logic that sets
    PIXMAN_EXPORT only uses it when building with MSVC, leaving some symbols
    hidden when building with MinGW.
    
    This results in an error when trying to link the tests:
    
    -----------------------------------------------------------------------
    FAILED: subprojects/pixman/test/combiner-test.exe
    x86_64-w64-mingw32-gcc  -o subprojects/pixman/test/combiner-test.exe 'subprojects/pixman/test/f48fa9c@@combiner-test at exe/combiner-test.c.obj' -Wl,--allow-shlib-undefined -Wl,--start-group subprojects/pixman/test/libtestutils.a subprojects/pixman/pixman/libpixman-1.dll.a -pthread -fopenmp -fopenmp -lm -mconsole -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 -Wl,--end-group
    /usr/bin/x86_64-w64-mingw32-ld: subprojects/pixman/test/f48fa9c@@combiner-test at exe/combiner-test.c.obj: in function `main':
    .../build/../subprojects/pixman/test/combiner-test.c:124: undefined reference to `_pixman_internal_only_get_implementation'
    collect2: error: ld returned 1 exit status
    ninja: build stopped: subcommand failed.
    -----------------------------------------------------------------------
    
    By using PIXMAN_API also when building with MinGW, the tests can link
    successfully and the build succeed.
    
    Tested with x86_64-w64-mingw32-gcc (GCC) 8.3-win32 20191201.

diff --git a/pixman/pixman-compiler.h b/pixman/pixman-compiler.h
index dd0da7c..a02aa49 100644
--- a/pixman/pixman-compiler.h
+++ b/pixman/pixman-compiler.h
@@ -95,7 +95,7 @@
 /* Sun Studio 8 visibility */
 #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
 #   define PIXMAN_EXPORT __global
-#elif defined (_MSC_VER)
+#elif defined (_MSC_VER) || defined(__MINGW32__)
 #   define PIXMAN_EXPORT PIXMAN_API
 #else
 #   define PIXMAN_EXPORT


More information about the xorg-commit mailing list