projects
/
mesa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Sun compilers now support some gcc __attribute__ values
[mesa.git]
/
src
/
mesa
/
main
/
compiler.h
diff --git
a/src/mesa/main/compiler.h
b/src/mesa/main/compiler.h
index 380663ec97107222afad35343515cf0c1ea4d053..9eab1ead2468d69b836a4a42058ec2fb8e252cd3 100644
(file)
--- a/
src/mesa/main/compiler.h
+++ b/
src/mesa/main/compiler.h
@@
-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
*/
* 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
# define PUBLIC __attribute__((visibility("default")))
# define USED __attribute__((used))
#else
@@
-234,7
+235,12
@@
extern "C" {
#elif defined(__APPLE__)
#include <CoreFoundation/CFByteOrder.h>
#define CPU_TO_LE32( x ) CFSwapInt32HostToLittle( x )
#elif defined(__APPLE__)
#include <CoreFoundation/CFByteOrder.h>
#define CPU_TO_LE32( x ) CFSwapInt32HostToLittle( x )
-#else /*__linux__ __APPLE__*/
+#elif (defined(_AIX) || defined(__blrts))
+#define CPU_TO_LE32( x ) x = ((x & 0x000000ff) << 24) | \
+ ((x & 0x0000ff00) << 8) | \
+ ((x & 0x00ff0000) >> 8) | \
+ ((x & 0xff000000) >> 24);
+#else /*__linux__ */
#include <sys/endian.h>
#define CPU_TO_LE32( x ) bswap32( x )
#endif /*__linux__*/
#include <sys/endian.h>
#define CPU_TO_LE32( x ) bswap32( x )
#endif /*__linux__*/