Sun cc 5.9 and later (__SUNPRO_C >= 0x590) support __attribute__ calls for aligned, always_inline, noinline, pure, const, and malloc. This commit includes updates to files that were regenerated by gl_XML.py after adding the __SUNPRO_C checks to it Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com> Signed-off-by: Brian Paul <brianp@vmware.com>tags/7.8-rc1
@@ -67,7 +67,8 @@ | |||
#elif defined(__CYGWIN__) && defined(USE_OPENGL32) /* use native windows opengl32 */ | |||
# define GLAPI extern | |||
# define GLAPIENTRY __stdcall | |||
#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303 | |||
#elif (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303) \ | |||
|| (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) | |||
# define GLAPI __attribute__((visibility("default"))) | |||
# define GLAPIENTRY | |||
#endif /* WIN32 && !CYGWIN */ |
@@ -64,7 +64,8 @@ | |||
/** | |||
* Function visibility | |||
*/ | |||
#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303 | |||
#if (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303) \ | |||
|| (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) | |||
# define PUBLIC __attribute__((visibility("default"))) | |||
#else | |||
# define PUBLIC |
@@ -104,7 +104,8 @@ typedef unsigned char boolean; | |||
/* Function visibility */ | |||
#ifndef PUBLIC | |||
# if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303 | |||
# if (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303) \ | |||
|| (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) | |||
# define PUBLIC __attribute__((visibility("default"))) | |||
# else | |||
# define PUBLIC | |||
@@ -140,7 +141,7 @@ typedef unsigned char boolean; | |||
/* Macros for data alignment. */ | |||
#if defined(__GNUC__) | |||
#if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) | |||
/* See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Type-Attributes.html */ | |||
#define PIPE_ALIGN_TYPE(_alignment, _type) _type __attribute__((aligned(_alignment))) |
@@ -47,7 +47,7 @@ | |||
# else | |||
# define FASTCALL | |||
# endif | |||
# if defined(__GNUC__) | |||
# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) | |||
# define NOINLINE __attribute__((noinline)) | |||
# else | |||
# define NOINLINE |
@@ -37,7 +37,7 @@ | |||
* \author Ian Romanick <idr@us.ibm.com> | |||
*/ | |||
# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) | |||
# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__) | |||
# define HIDDEN __attribute__((visibility("hidden"))) | |||
# else | |||
# define HIDDEN | |||
@@ -47,7 +47,7 @@ | |||
# else | |||
# define FASTCALL | |||
# endif | |||
# if defined(__GNUC__) | |||
# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) | |||
# define NOINLINE __attribute__((noinline)) | |||
# else | |||
# define NOINLINE |
@@ -29,7 +29,7 @@ | |||
#include <GL/gl.h> | |||
#include "indirect_size.h" | |||
# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) | |||
# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) | |||
# define PURE __attribute__((pure)) | |||
# else | |||
# define PURE | |||
@@ -41,7 +41,7 @@ | |||
# define FASTCALL | |||
# endif | |||
# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) | |||
# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__) | |||
# define INTERNAL __attribute__((visibility("internal"))) | |||
# else | |||
# define INTERNAL |
@@ -36,7 +36,7 @@ | |||
* \author Ian Romanick <idr@us.ibm.com> | |||
*/ | |||
# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) | |||
# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) | |||
# define PURE __attribute__((pure)) | |||
# else | |||
# define PURE | |||
@@ -48,7 +48,7 @@ | |||
# define FASTCALL | |||
# endif | |||
# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) | |||
# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__) | |||
# define INTERNAL __attribute__((visibility("internal"))) | |||
# else | |||
# define INTERNAL |
@@ -184,7 +184,7 @@ class gl_print_base: | |||
The name is also added to the file's undef_list. | |||
""" | |||
self.undef_list.append("PURE") | |||
print """# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) | |||
print """# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) | |||
# define PURE __attribute__((pure)) | |||
# else | |||
# define PURE | |||
@@ -224,7 +224,7 @@ class gl_print_base: | |||
""" | |||
self.undef_list.append(S) | |||
print """# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) | |||
print """# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__) | |||
# define %s __attribute__((visibility("%s"))) | |||
# else | |||
# define %s | |||
@@ -244,7 +244,7 @@ class gl_print_base: | |||
""" | |||
self.undef_list.append("NOINLINE") | |||
print """# if defined(__GNUC__) | |||
print """# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) | |||
# define NOINLINE __attribute__((noinline)) | |||
# else | |||
# define NOINLINE |
@@ -27,7 +27,7 @@ | |||
*/ | |||
# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) | |||
# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__) | |||
# define HIDDEN __attribute__((visibility("hidden"))) | |||
# else | |||
# define HIDDEN |
@@ -173,7 +173,8 @@ extern "C" { | |||
* 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 | |||
*/ | |||
#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303 | |||
#if (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303) \ | |||
|| (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) | |||
# define PUBLIC __attribute__((visibility("default"))) | |||
# define USED __attribute__((used)) | |||
#else |