src/cpuinfo/SDL_cpuinfo.c
changeset 13945 465afae5eb7e
parent 13922 23d4515c00b4
child 14014 1b8e12692202
     1.1 --- a/src/cpuinfo/SDL_cpuinfo.c	Wed Jul 08 17:28:34 2020 +0200
     1.2 +++ b/src/cpuinfo/SDL_cpuinfo.c	Sat Jul 11 08:10:02 2020 +0300
     1.3 @@ -49,7 +49,7 @@
     1.4  #endif
     1.5  #if defined(__MACOSX__) && (defined(__ppc__) || defined(__ppc64__))
     1.6  #include <sys/sysctl.h>         /* For AltiVec check */
     1.7 -#elif defined(__OpenBSD__) && defined(__powerpc__)
     1.8 +#elif (defined(__OpenBSD__) || defined(__FreeBSD__)) && defined(__powerpc__)
     1.9  #include <sys/param.h>
    1.10  #include <sys/sysctl.h> /* For AltiVec check */
    1.11  #include <machine/cpu.h>
    1.12 @@ -314,9 +314,11 @@
    1.13  {
    1.14      volatile int altivec = 0;
    1.15  #ifndef SDL_CPUINFO_DISABLED
    1.16 -#if (defined(__MACOSX__) && (defined(__ppc__) || defined(__ppc64__))) || (defined(__OpenBSD__) && defined(__powerpc__))
    1.17 +#if (defined(__MACOSX__) && (defined(__ppc__) || defined(__ppc64__))) || (defined(__OpenBSD__) && defined(__powerpc__)) || (defined(__FreeBSD__) && defined(__powerpc__))
    1.18  #ifdef __OpenBSD__
    1.19      int selectors[2] = { CTL_MACHDEP, CPU_ALTIVEC };
    1.20 +#elif defined(__FreeBSD__)
    1.21 +    int selectors[2] = { CTL_HW, PPC_FEATURE_HAS_ALTIVEC };
    1.22  #else
    1.23      int selectors[2] = { CTL_HW, HW_VECTORUNIT };
    1.24  #endif