Skip to content

Fix -Wexpansion-to-defined warning

player-03 requested to merge player-03/pixman:Wexpansion-to-defined into master

_PIXMAN_X86_64 is defined in a way that works but isn't officially supported. This produces one of a few error messages:

clang, MSVC: warning: macro expansion producing 'defined' has undefined behavior

GCC: warning: this use of "defined" may not be portable

In MSVC and GCC, you have to go out of your way to enable the warning, but clang includes it in -Wall, making it much more common there.


Just for the record, here's an equally-valid alternate solution.

#if defined (__amd64__) || defined (__x86_64__) || defined (_M_AMD64)
#define _PIXMAN_X86_64 1
#else
#define _PIXMAN_X86_64 0
#endif

Merge request reports