i965: switch gen6 to use its own cc state bo
[mesa.git] / src / mesa / main / compiler.h
index 81704ae2c1166cf1bb913bdd8f61837e0b087b04..5557a3b5cb5ac4ffd804bb27d84ee22d389dc6c6 100644 (file)
@@ -65,9 +65,7 @@ extern "C" {
    typedef unsigned __int8    uint8_t;
    typedef __int16            int16_t;
    typedef unsigned __int16   uint16_t;
-#  ifndef __eglplatform_h_
-     typedef __int32            int32_t;
-#  endif
+   typedef __int32            int32_t;
    typedef unsigned __int32   uint32_t;
    typedef __int64            int64_t;
    typedef unsigned __int64   uint64_t;
@@ -200,6 +198,13 @@ extern "C" {
 #  define __builtin_expect(x, y) x
 #endif
 
+#ifdef __GNUC__
+#define likely(x) __builtin_expect(!!(x), 1)
+#define unlikely(x) __builtin_expect(!!(x), 0)
+#else
+#define likely(x) !!(x)
+#define unlikely(x) !!(x)
+#endif
 
 /**
  * The __FUNCTION__ gcc variable is generally only used for debugging.
@@ -219,6 +224,18 @@ extern "C" {
 #  endif
 # endif
 #endif
+#ifndef __func__
+#  if (__STDC_VERSION__ >= 199901L) || \
+      (defined(__SUNPRO_C) && defined(__C99FEATURES__))
+       /* __func__ is part of C99 */
+#  elif defined(_MSC_VER)
+#    if _MSC_VER >= 1300
+#      define __func__ __FUNCTION__
+#    else
+#      define __func__ "<unknown>"
+#    endif
+#  endif
+#endif
 
 
 /**
@@ -311,6 +328,11 @@ static INLINE GLuint CPU_TO_LE32(GLuint x)
 #endif
 #endif
 
+#if (__GNUC__ >= 3)
+#define PRINTFLIKE(f, a) __attribute__ ((format(__printf__, f, a)))
+#else
+#define PRINTFLIKE(f, a)
+#endif
 
 #ifndef NULL
 #define NULL 0
@@ -336,6 +358,10 @@ static INLINE GLuint CPU_TO_LE32(GLuint x)
 #define M_E (2.7182818284590452354)
 #endif
 
+#ifndef M_LOG2E
+#define M_LOG2E     (1.4426950408889634074)
+#endif
+
 #ifndef ONE_DIV_LN2
 #define ONE_DIV_LN2 (1.442695040888963456)
 #endif