X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Finclude%2Fpipe%2Fp_compiler.h;h=c36286f9bee49b1eac55f3c798f5dad8a9b7c41a;hb=6fd8b9b550713302566bb4c28e49c219870ccfec;hp=bc2a0a7ef3ae278f0121c3859c43b8cda734c7a3;hpb=dceb09909ea9d6eaef0334897ebed6da45db6faa;p=mesa.git diff --git a/src/gallium/include/pipe/p_compiler.h b/src/gallium/include/pipe/p_compiler.h index bc2a0a7ef3a..c36286f9bee 100644 --- a/src/gallium/include/pipe/p_compiler.h +++ b/src/gallium/include/pipe/p_compiler.h @@ -93,9 +93,11 @@ typedef int _Bool; #endif +#ifndef __HAIKU__ typedef unsigned int uint; -typedef unsigned char ubyte; typedef unsigned short ushort; +#endif +typedef unsigned char ubyte; #if 0 #define boolean bool @@ -124,11 +126,30 @@ typedef unsigned char boolean; # define INLINE inline # elif defined(__WATCOMC__) && (__WATCOMC__ >= 1100) # define INLINE __inline +# elif defined(__SUNPRO_C) && defined(__C99FEATURES__) +# define INLINE inline +# elif (__STDC_VERSION__ >= 199901L) /* C99 */ +# define INLINE inline # else # define INLINE # endif #endif +/* The __FUNCTION__ gcc variable is generally only used for debugging. + * If we're not using gcc, define __FUNCTION__ as a cpp symbol here. + */ +#ifndef __FUNCTION__ +# if (!defined(__GNUC__) || (__GNUC__ < 2)) +# if (__STDC_VERSION__ >= 199901L) /* C99 */ || \ + (defined(__SUNPRO_C) && defined(__C99FEATURES__)) +# define __FUNCTION__ __func__ +# else +# define __FUNCTION__ "" +# endif +# endif +#endif + + /* This should match linux gcc cdecl semantics everywhere, so that we * just codegen one calling convention on all platforms. @@ -146,11 +167,17 @@ typedef unsigned char boolean; #define ALIGN16_ASSIGN(NAME) NAME##___aligned #define ALIGN16_ATTRIB __attribute__(( aligned( 16 ) )) #define ALIGN8_ATTRIB __attribute__(( aligned( 8 ) )) +#if __GNUC__ > 4 || (__GNUC__ == 4 &&__GNUC_MINOR__>1) +#define ALIGN_STACK __attribute__((force_align_arg_pointer)) +#else +#define ALIGN_STACK +#endif #else #define ALIGN16_DECL(TYPE, NAME, SIZE) TYPE NAME##___unaligned[SIZE + 1] #define ALIGN16_ASSIGN(NAME) align16(NAME##___unaligned) #define ALIGN16_ATTRIB #define ALIGN8_ATTRIB +#define ALIGN_STACK #endif