diff options
author | Antonio Ospite <ao2@ao2.it> | 2020-03-14 23:53:39 +0100 |
---|---|---|
committer | Antonio Ospite <ao2@ao2.it> | 2020-03-15 00:19:56 +0100 |
commit | 3344f507dd4483643a4f238ea303ba49fc8469fc (patch) | |
tree | e80cce9876ebd53c48cf12632eea35a6eae3e00e | |
parent | 127d9525d63bd51f97ef64c66a4e8fb351309738 (diff) | |
download | pixman-3344f507dd4483643a4f238ea303ba49fc8469fc.tar.gz |
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@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@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.
-rw-r--r-- | pixman/pixman-compiler.h | 2 |
1 files changed, 1 insertions, 1 deletions
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 |