# HG changeset patch # User diego # Date 1222061930 0 # Node ID 47717d5239fa839c44189e7a1068dbb1599778c2 # Parent ad95dd08b31abb21756a3b25bafd51f6c524a490 AltiVec detection support for OpenBSD, patch by Brad, brad comstyle com. diff -r ad95dd08b31a -r 47717d5239fa ppc/check_altivec.c --- a/ppc/check_altivec.c Mon Sep 22 03:00:26 2008 +0000 +++ b/ppc/check_altivec.c Mon Sep 22 05:38:50 2008 +0000 @@ -25,6 +25,10 @@ #ifdef __APPLE__ #undef _POSIX_C_SOURCE #include +#elif __OpenBSD__ +#include +#include +#include #elif __AMIGAOS4__ #include #include @@ -45,8 +49,12 @@ IExec->GetCPUInfoTags(GCIT_VectorUnit, &result, TAG_DONE); if (result == VECTORTYPE_ALTIVEC) return 1; return 0; -#elif __APPLE__ +#elif defined(__APPLE__) || defined(__OpenBSD__) +#ifdef __OpenBSD__ + int sels[2] = {CTL_MACHDEP, CPU_ALTIVEC}; +#else int sels[2] = {CTL_HW, HW_VECTORUNIT}; +#endif int has_vu = 0; size_t len = sizeof(has_vu); int err;