Index: cpudetect.c =================================================================== --- cpudetect.c (revision 27666) +++ cpudetect.c (working copy) @@ -29,6 +29,10 @@ #include #endif +#ifdef __sun +#include +#endif + #ifdef WIN32 #include #endif @@ -187,7 +191,7 @@ #if defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) \ || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) \ || defined(__APPLE__) || defined(__CYGWIN__) || defined(__MINGW32__) \ - || defined(__OS2__) + || defined(__OS2__) || defined(__sun) if (caps->hasSSE) check_os_katmai_support(); if (!caps->hasSSE) @@ -363,6 +367,20 @@ #ifdef ARCH_X86_64 gCpuCaps.hasSSE=1; gCpuCaps.hasSSE2=1; +#elif defined(__sun) + struct utsname solname; + long major, minor = 0; + char *radix; + + if (uname(&solname) > 0) { + major = strtol(solname.release, &radix, 10); + if (*radix != '\0') + minor = strtol(++radix, NULL, 10); + if (!(major >= 5 && minor >= 9)) + gCpuCaps.hasSSE=0; + } else { + gCpuCaps.hasSSE=0; + } #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) || defined(__APPLE__) int has_sse=0, ret; size_t len=sizeof(has_sse);