/** * @file llhash.h * @brief Wrapper for a hash function. * * Copyright (c) 2004-$CurrentYear$, Linden Research, Inc. * $License$ */ #ifndef LL_LLHASH_H #define LL_LLHASH_H #include "llpreprocessor.h" // for GCC_VERSION #if (LL_WINDOWS) #include #include #elif LL_DARWIN || LL_LINUX # if GCC_VERSION >= 30400 // gcc 3.4 and up # include # elif __GNUC__ >= 3 # include # else # include # endif #elif LL_SOLARIS #include #else #error Please define your platform. #endif template inline size_t llhash(T value) { #if LL_WINDOWS return stdext::hash_value(value); #elif ( (defined _STLPORT_VERSION) || ((LL_LINUX) && (__GNUC__ <= 2)) ) std::hash H; return H(value); #elif LL_DARWIN || LL_LINUX || LL_SOLARIS __gnu_cxx::hash H; return H(value); #else #error Please define your platform. #endif } #endif