if some header defines MIN/MAX before cairoint.h is included, it causes a compile warning because cairoint.h defines these two unconditionally. The definitions for TRUE/FALSE have an #ifndef around them, I think MIN/MAX should too.
Created attachment 2995 [details] [review] patch
Move bugs against "cvs" version to "0.9.3" so we can remove the "cvs" version.
For GLib, we made the decision that TRUE / FALSE can only be defined one way, so use #ifndef, #define, but MIN/MAX might conceivably have different definitions, so what we do there instead is #undef MIN #define MIN(a, b) (((a) < (b)) ? (a) : (b)) Other definitions could be specific to some types, try to avoid multiple evaluation, or whatever. I would suggest the same for Cairo. In fact, it's well enough tested for GLib that I'll just go ahead and do it, even if it looks a little strange to do different things for TRUE/FALSE and MIN/MAX. 2005-08-27 Owen Taylor <otaylor@redhat.com> * src/cairoint.h: Undef MIN/MAX before defining them in case some system header happens to define them. (#4196, Christian Biesinger)
Just a note that I'm reopening this bug because the following files have the same problem in cairo 1.0.2 (i.e. redefining MIN/MAX without undef'ing first, which causes a gcc 4.0.2 compiler warning for me on HP-UX 11.X): pixman/src/icint.h pixman/src/pixregion.c
Thanks. I just fixed these two files as well, (in the same undef style as used in cairoint.h). -Carl
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.