[Pixman] 'SIZE_MAX' undeclared on Solaris 9 without including <limits.h>, sqrtf() missing

Mojca Miklavec mojca.miklavec.lists at gmail.com
Wed Mar 20 09:02:20 PDT 2013


We are using pixman in TeX (TeX Live) and on Solaris there are two
tiny problems that prevent compilation on Solaris 9:

1.) ../../../source/libs/pixman/pixman-0.28.0/pixman/pixman-utils.c:36:17:
 error: 'SIZE_MAX' undeclared (first use in this function)

One possible solution is adding
    #include <limits.h>
to pixman-utils.c, but I'm not sure how to include this properly
without interfering with other compilers. (I guess that simply adding
limits.h unconditionally should work, but I don't know for sure.
) Here's an example from a different project:
that uses

/* Get SIZE_MAX declaration on systems like Solaris 7/8/9.  */
# include <limits.h>
/* Get SIZE_MAX declaration on systems like glibc 2.  */
#  include <stdint.h>
# endif
/* On systems where these include files don't define it, SIZE_MAX is defined
   in config.h.  */

Developer of LuaTeX/MetaPost used another trick as a patch:

--- pixman-0.28.0.orig/pixman/pixman-utils.c
+++ pixman-0.28.0/pixman/pixman-utils.c
@@ -33,7 +33,7 @@
 _pixman_multiply_overflows_size (size_t a, size_t b)
-    return a >= SIZE_MAX / b;
+    return a >= ((size_t)-1) / b;


2.) "sqrtf" function is missing, see also:


One can use double sqrt(...) instead, but again, I'm not sure what the
best patch should be.

(Developers of OpenSource projects can get access to a solaris build
farm, so testing itself shouldn't be a problem.)

If I patch these two items, everything else works, so I would be
grateful if someone could look into these tiny issues.

Thank you,

More information about the Pixman mailing list