core | glapi | vbo | math | shader | swrast | swrast_setup | tnl | tnl_dd

compiler.h File Reference


Detailed Description

Compiler-related stuff.

#include <assert.h>
#include <ctype.h>
#include <math.h>
#include <limits.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <float.h>
#include <stdarg.h>
#include <stdint.h>

Defines

#define INLINE
 Get standard integer types.
#define PUBLIC
 PUBLIC/USED macros.
#define USED
#define CONST   const
 Some compilers don't like some of Mesa's const usage.
#define __builtin_expect(x, y)   x
 __builtin_expect macros
#define __FUNCTION__   "<unknown>"
 The __FUNCTION__ gcc variable is generally only used for debugging.
#define CPU_TO_LE32(x)   ( x )
 Either define MESA_BIG_ENDIAN or MESA_LITTLE_ENDIAN.
#define MESA_LITTLE_ENDIAN   1
#define LE32_TO_CPU(x)   CPU_TO_LE32( x )
#define _ASMAPI
 Create a macro so that asm functions can be linked into compilers other than GNU C.
#define _ASMAPIP   _ASMAPI *
#define _NORMAPI
#define _NORMAPIP   *
#define ASSERT(X)
 ASSERT macro.
#define NULL   0
#define LONGSTRING
 LONGSTRING macro gcc -pedantic warns about long string literals, LONGSTRING silences that.
#define M_PI   (3.1415926536)
#define M_E   (2.7182818284590452354)
#define ONE_DIV_LN2   (1.442695040888963456)
#define ONE_DIV_SQRT_LN2   (1.201122408786449815)
#define FLT_MAX_EXP   128
#define START_FAST_MATH(x)   x = 0
 USE_IEEE: Determine if we're using IEEE floating point.
#define END_FAST_MATH(x)   (void)(x)
#define Elements(x)   (sizeof(x)/sizeof(*(x)))


Define Documentation

#define __builtin_expect ( x,
 )     x

__builtin_expect macros

#define __FUNCTION__   "<unknown>"

The __FUNCTION__ gcc variable is generally only used for debugging.

If we're not using gcc, define __FUNCTION__ as a cpp symbol here. Don't define it if using a newer Windows compiler.

#define _ASMAPI

Create a macro so that asm functions can be linked into compilers other than GNU C.

#define _ASMAPIP   _ASMAPI *

#define _NORMAPI

#define _NORMAPIP   *

#define ASSERT (  ) 

ASSERT macro.

#define CONST   const

Some compilers don't like some of Mesa's const usage.

In those places use CONST instead of const. Pass -DNO_CONST to compilers where this matters.

#define CPU_TO_LE32 (  )     ( x )

Either define MESA_BIG_ENDIAN or MESA_LITTLE_ENDIAN.

Do not use them unless absolutely necessary! Try to use a runtime test instead. For now, only used by some DRI hardware drivers for color/texel packing.

#define Elements (  )     (sizeof(x)/sizeof(*(x)))

#define END_FAST_MATH (  )     (void)(x)

#define FLT_MAX_EXP   128

#define INLINE

Get standard integer types.

Sun compilers define __i386 instead of the gcc-style __i386__ finite macro. Disable assorted warnings Function inlining

#define LE32_TO_CPU (  )     CPU_TO_LE32( x )

#define LONGSTRING

LONGSTRING macro gcc -pedantic warns about long string literals, LONGSTRING silences that.

#define M_E   (2.7182818284590452354)

#define M_PI   (3.1415926536)

#define MESA_LITTLE_ENDIAN   1

#define NULL   0

#define ONE_DIV_LN2   (1.442695040888963456)

#define ONE_DIV_SQRT_LN2   (1.201122408786449815)

#define PUBLIC

PUBLIC/USED macros.

If we build the library with gcc's -fvisibility=hidden flag, we'll use the PUBLIC macro to mark functions that are to be exported.

We also need to define a USED attribute, so the optimizer doesn't inline a static function that we later use in an alias. - ajax

#define START_FAST_MATH (  )     x = 0

USE_IEEE: Determine if we're using IEEE floating point.

START/END_FAST_MATH macros:

START_FAST_MATH: Set x86 FPU to faster, 32-bit precision mode (and save original mode to a temporary). END_FAST_MATH: Restore x86 FPU to original mode.

#define USED


Generated on Sun Sep 27 06:47:45 2009 for Mesa Main by  doxygen 1.5.4