Move compiler dependencies to a new pixman-compiler.h file
authorSøren Sandmann Pedersen <sandmann@redhat.com>
Sun, 21 Jun 2009 15:15:30 +0000 (11:15 -0400)
committerSøren Sandmann Pedersen <sandmann@redhat.com>
Sun, 21 Jun 2009 17:29:59 +0000 (13:29 -0400)
pixman/Makefile.am
pixman/pixman-compiler.h [new file with mode: 0644]
pixman/pixman-private.h

index 1f6afb4..4593757 100644 (file)
@@ -10,6 +10,7 @@ libpixman_1_la_SOURCES =                      \
        pixman-gradient-walker.c                \
        pixman-region16.c                       \
        pixman-region32.c                       \
+       pixman-compiler.h                       \
        pixman-private.h                        \
        pixman-image.c                          \
        pixman-implementation.c                 \
diff --git a/pixman/pixman-compiler.h b/pixman/pixman-compiler.h
new file mode 100644 (file)
index 0000000..466199d
--- /dev/null
@@ -0,0 +1,71 @@
+/* Pixman uses some non-standard compiler features. This file ensures
+ * they exist
+ *
+ * The features are:
+ *
+ *    FUNC          must be defined to expand to the current function
+ *    PIXMAN_EXPORT  should be defined to whatever is required to
+ *                   export functions from a shared library
+ *    limits        limits for various types must be defined
+ *    inline         must be defined
+ *    force_inline   must be defined
+ */
+#if defined (__GNUC__)
+#  define FUNC     ((const char*) (__PRETTY_FUNCTION__))
+#elif defined (__sun) || (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
+#  define FUNC     ((const char*) (__func__))
+#else
+#  define FUNC     ((const char*) ("???"))
+#endif
+
+#ifndef INT16_MIN
+# define INT16_MIN              (-32767-1)
+#endif
+
+#ifndef INT16_MAX
+# define INT16_MAX              (32767)
+#endif
+
+#ifndef INT32_MIN
+# define INT32_MIN              (-2147483647-1)
+#endif
+
+#ifndef INT32_MAX
+# define INT32_MAX              (2147483647)
+#endif
+
+#ifndef UINT32_MIN
+# define UINT32_MIN             (0)
+#endif
+
+#ifndef UINT32_MAX
+# define UINT32_MAX             (4294967295U)
+#endif
+
+#ifndef M_PI
+# define M_PI                  3.14159265358979323846
+#endif
+
+#ifdef _MSC_VER
+/* 'inline' is available only in C++ in MSVC */
+#   define inline __inline
+#   define force_inline __forceinline
+#elif defined __GNUC__ || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
+#   define inline __inline__
+#   define force_inline __inline__ __attribute__ ((__always_inline__))
+#else
+# ifndef force_inline
+#  define force_inline inline
+# endif
+#endif
+
+/* 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
+
index 4fae0fc..753d705 100644 (file)
@@ -9,6 +9,9 @@
 #include <time.h>
 #include <assert.h>
 
+#include "pixman-compiler.h"
+
+
 #ifndef FALSE
 #define FALSE 0
 #endif
 #undef DEBUG
 #define DEBUG 0
 
-#if defined (__GNUC__)
-#  define FUNC     ((const char*) (__PRETTY_FUNCTION__))
-#elif defined (__sun) || (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
-#  define FUNC     ((const char*) (__func__))
-#else
-#  define FUNC     ((const char*) ("???"))
-#endif
-
-#ifndef INT16_MIN
-# define INT16_MIN              (-32767-1)
-#endif
-
-#ifndef INT16_MAX
-# define INT16_MAX              (32767)
-#endif
-
-#ifndef INT32_MIN
-# define INT32_MIN              (-2147483647-1)
-#endif
-
-#ifndef INT32_MAX
-# define INT32_MAX              (2147483647)
-#endif
-
-#ifndef UINT32_MIN
-# define UINT32_MIN             (0)
-#endif
-
-#ifndef UINT32_MAX
-# define UINT32_MAX             (4294967295U)
-#endif
-
-#ifndef M_PI
-# define M_PI                  3.14159265358979323846
-#endif
-
-#ifdef _MSC_VER
-/* 'inline' is available only in C++ in MSVC */
-#   define inline __inline
-#   define force_inline __forceinline
-#elif defined __GNUC__ || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
-#   define inline __inline__
-#   define force_inline __inline__ __attribute__ ((__always_inline__))
-#else
-# ifndef force_inline
-#  define force_inline inline
-# endif
-#endif
-
 #define FB_SHIFT    5
 #define FB_UNIT     (1 << FB_SHIFT)
 #define FB_HALFUNIT (1 << (FB_SHIFT-1))
@@ -742,16 +696,6 @@ pixman_compute_composite_region32 (pixman_region32_t *     pRegion,
                                   uint16_t             width,
                                   uint16_t             height);
 
-/* 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
-
 /* Region Helpers */
 pixman_bool_t pixman_region32_copy_from_region16 (pixman_region32_t *dst,
                                                  pixman_region16_t *src);