From: Ginn Chen Date: Thu, 21 Aug 2008 21:21:01 +0000 (-0700) Subject: Use hidden attribute for private functions when compiling with Sun Studio X-Git-Tag: pixman-0.11.10~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9b9f7b59e5ce17735157ca9b154e8bc545f5c96b;p=platform%2Fupstream%2Fpixman.git Use hidden attribute for private functions when compiling with Sun Studio https://bugs.freedesktop.org/show_bug.cgi?id=17183 Signed-off-by: Alan Coopersmith --- diff --git a/configure.ac b/configure.ac index 702bed0..0cf32c7 100644 --- a/configure.ac +++ b/configure.ac @@ -123,6 +123,21 @@ if test "x$have_gcc4" = "xyes"; then fi AC_MSG_RESULT($have_gcc4) +have_sunstudio8=no +AC_MSG_CHECKING([for -xldscope (Sun compilers)]) +AC_COMPILE_IFELSE([ +#if defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550) +#else +#error Need Sun Studio 8 for visibility +#endif +int main () { return 0; } +], have_sunstudio8=yes) + +if test "x$have_sunstudio8" = "xyes"; then + CFLAGS="$CFLAGS -xldscope=hidden" +fi +AC_MSG_RESULT($have_sunstudio8) + dnl =========================================================================== dnl Check for MMX diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h index a27d2a8..e26a0c3 100644 --- a/pixman/pixman-private.h +++ b/pixman/pixman-private.h @@ -729,6 +729,9 @@ pixman_compute_composite_region32 (pixman_region32_t * pRegion, /* GCC visibility */ #if defined(__GNUC__) && __GNUC__ >= 4 #define PIXMAN_EXPORT __attribute__ ((visibility("default"))) +/* Sun Studio 8 visibility */ +#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550) +#define PIXMAN_EXPORT __global #else #define PIXMAN_EXPORT #endif