Bug 579856 Failed to build angle code with Sun Studio 12 r=vlad a=joedrew

This commit is contained in:
Ginn Chen 2010-07-30 18:54:04 +08:00
parent ba9a804f7b
commit 3ed86f3dc2
4 changed files with 17 additions and 1 deletions

View File

@ -7,6 +7,8 @@ Local patches:
angle-shared.patch - add declspec dllexport/dllimport support on win32
angle-sunstudio.patch - Fix compilation with Sun Studio on Solaris
To regenerate the flex/yacc generated files:
flex --noline --nounistd --outfile=generated/glslang.cpp src/compiler/glslang.l

View File

@ -7,6 +7,10 @@
#ifndef _BASICTYPES_INCLUDED_
#define _BASICTYPES_INCLUDED_
#if defined(__SUNPRO_C) || defined(__SUNPRO_CC)
#define __inline inline
#endif
//
// Precision qualifiers
//

View File

@ -147,7 +147,7 @@ void TOutputGLSL::writeFunctionParameters(const TIntermSequence& args)
out << arrayBrackets(type);
// Put a comma if this is not the last argument.
if (iter != --args.end())
if (iter != args.end() - 1)
out << ", ";
}
}

View File

@ -263,12 +263,22 @@ public:
template<class Other>
pool_allocator(const pool_allocator<Other>& p) : allocator(p.getAllocator()) { }
#if defined(__SUNPRO_CC) && !defined( _RWSTD_ALLOCATOR)
// libCStd on Solaris has a differenet interface of allocate()
void* allocate(size_type n) {
return getAllocator().allocate(n);
}
void* allocate(size_type n, const void*) {
return getAllocator().allocate(n);
}
#else
pointer allocate(size_type n) {
return reinterpret_cast<pointer>(getAllocator().allocate(n * sizeof(T)));
}
pointer allocate(size_type n, const void*) {
return reinterpret_cast<pointer>(getAllocator().allocate(n * sizeof(T)));
}
#endif
void deallocate(void*, size_type) { }
void deallocate(pointer, size_type) { }