MIPSpro compilation fixes / workarounds (from a patch by Rainer Canavan)

The hashmap.h change is ugly, but so far the only thing found to work. Suggestions for a better "fix" appreciated!

svn-id: r43380
This commit is contained in:
Joost Peters 2009-08-14 17:18:03 +00:00
parent ddf617e2a7
commit edaa4a0422
3 changed files with 22 additions and 0 deletions

View file

@ -39,6 +39,13 @@
#endif
namespace Common {
/**
* The sgi IRIX MIPSpro Compiler has difficulties with nested templates.
* This and the other __sgi conditionals below work around these problems.
*/
#ifdef __sgi
template<class T> class IteratorImpl;
#endif
// Enable the following #define if you want to check how many collisions the
// code produces (many collisions indicate either a bad hash function, or a
@ -125,7 +132,9 @@ public:
int lookupAndCreateIfMissing(const Key &key);
void expandStorage(uint newCapacity);
#ifndef __sgi
template<class T> friend class IteratorImpl;
#endif
/**
* Simple HashMap iterator implementation.
@ -133,7 +142,11 @@ public:
template<class NodeType>
class IteratorImpl {
friend class HashMap;
#ifdef __sgi
template<class T> friend class Common::IteratorImpl;
#else
template<class T> friend class IteratorImpl;
#endif
protected:
typedef const HashMap hashmap_t;

View file

@ -25,6 +25,11 @@
#define __restrict__
#endif
#ifdef __sgi
#define __restrict__ __restrict
#endif
typedef unsigned char scale2x_uint8;
typedef unsigned short scale2x_uint16;
typedef unsigned scale2x_uint32;

View file

@ -25,6 +25,10 @@
#define __restrict__
#endif
#ifdef __sgi
#define __restrict__ __restrict
#endif
typedef unsigned char scale3x_uint8;
typedef unsigned short scale3x_uint16;
typedef unsigned scale3x_uint32;