00001
00032 #ifndef LL_LLHASH_H
00033 #define LL_LLHASH_H
00034
00035 #include "llpreprocessor.h"
00036
00037 #if (LL_WINDOWS)
00038 #include <hash_map>
00039 #include <algorithm>
00040 #elif LL_DARWIN || LL_LINUX
00041 # if GCC_VERSION >= 30400 // gcc 3.4 and up
00042 # include <ext/hashtable.h>
00043 # elif __GNUC__ >= 3
00044 # include <ext/stl_hashtable.h>
00045 # else
00046 # include <hashtable.h>
00047 # endif
00048 #elif LL_SOLARIS
00049 #include <ext/hashtable.h>
00050 #else
00051 #error Please define your platform.
00052 #endif
00053
00054 template<class T> inline size_t llhash(T value)
00055 {
00056 #if LL_WINDOWS
00057 return stdext::hash_value<T>(value);
00058 #elif ( (defined _STLPORT_VERSION) || ((LL_LINUX) && (__GNUC__ <= 2)) )
00059 std::hash<T> H;
00060 return H(value);
00061 #elif LL_DARWIN || LL_LINUX || LL_SOLARIS
00062 __gnu_cxx::hash<T> H;
00063 return H(value);
00064 #else
00065 #error Please define your platform.
00066 #endif
00067 }
00068
00069 #endif
00070