@ -114,10 +114,14 @@ void* allocSingletonNewBuffer(size_t size) { return malloc(size); }
# include <cstdlib> // std::abort
# include <cstdlib> // std::abort
# endif
# endif
# if defined __ANDROID__ || defined __linu x__ || defined __FreeBSD__ || defined __OpenBSD__ || defined __HAIKU__
# if defined __ANDROID__ || defined __uni x__ || defined __FreeBSD__ || defined __OpenBSD__ || defined __HAIKU__
# include <unistd.h>
# include <unistd.h>
# include <fcntl.h>
# include <fcntl.h>
# if defined __QNXNTO__
# include <sys / elf.h>
# else
# include <elf.h>
# include <elf.h>
# endif
# if defined __ANDROID__ || defined __linux__
# if defined __ANDROID__ || defined __linux__
# include <linux / auxvec.h>
# include <linux / auxvec.h>
# endif
# endif
@ -128,7 +132,7 @@ void* allocSingletonNewBuffer(size_t size) { return malloc(size); }
# endif
# endif
# if (defined __ppc64__ || defined __PPC64__) && defined __linu x__
# if (defined __ppc64__ || defined __PPC64__) && defined __uni x__
# include "sys / auxv.h"
# include "sys / auxv.h"
# ifndef AT_HWCAP2
# ifndef AT_HWCAP2
# define AT_HWCAP2 26
# define AT_HWCAP2 26
@ -229,7 +233,7 @@ std::wstring GetTempFileNameWinRT(std::wstring prefix)
# include "omp.h"
# include "omp.h"
# endif
# endif
# if defined __linu x__ || defined __APPLE__ || defined __EMSCRIPTEN__ || defined __FreeBSD__ || defined __GLIBC__ || defined __HAIKU__
# if defined __uni x__ || defined __APPLE__ || defined __EMSCRIPTEN__ || defined __FreeBSD__ || defined __GLIBC__ || defined __HAIKU__
# include <unistd.h>
# include <unistd.h>
# include <stdio.h>
# include <stdio.h>
# include <sys/types.h>
# include <sys/types.h>
@ -591,7 +595,7 @@ struct HWFeatures
have [ CV_CPU_MSA ] = true ;
have [ CV_CPU_MSA ] = true ;
# endif
# endif
# if (defined __ppc64__ || defined __PPC64__) && defined __linu x__
# if (defined __ppc64__ || defined __PPC64__) && defined __uni x__
unsigned int hwcap = getauxval ( AT_HWCAP ) ;
unsigned int hwcap = getauxval ( AT_HWCAP ) ;
if ( hwcap & PPC_FEATURE_HAS_VSX ) {
if ( hwcap & PPC_FEATURE_HAS_VSX ) {
hwcap = getauxval ( AT_HWCAP2 ) ;
hwcap = getauxval ( AT_HWCAP2 ) ;
@ -804,12 +808,12 @@ int64 getTickCount(void)
LARGE_INTEGER counter ;
LARGE_INTEGER counter ;
QueryPerformanceCounter ( & counter ) ;
QueryPerformanceCounter ( & counter ) ;
return ( int64 ) counter . QuadPart ;
return ( int64 ) counter . QuadPart ;
# elif defined __linux || defined __linux__
# elif defined __MACH__ && defined __APPLE__
return ( int64 ) mach_absolute_time ( ) ;
# elif defined __unix__
struct timespec tp ;
struct timespec tp ;
clock_gettime ( CLOCK_MONOTONIC , & tp ) ;
clock_gettime ( CLOCK_MONOTONIC , & tp ) ;
return ( int64 ) tp . tv_sec * 1000000000 + tp . tv_nsec ;
return ( int64 ) tp . tv_sec * 1000000000 + tp . tv_nsec ;
# elif defined __MACH__ && defined __APPLE__
return ( int64 ) mach_absolute_time ( ) ;
# else
# else
struct timeval tv ;
struct timeval tv ;
gettimeofday ( & tv , NULL ) ;
gettimeofday ( & tv , NULL ) ;
@ -823,8 +827,6 @@ double getTickFrequency(void)
LARGE_INTEGER freq ;
LARGE_INTEGER freq ;
QueryPerformanceFrequency ( & freq ) ;
QueryPerformanceFrequency ( & freq ) ;
return ( double ) freq . QuadPart ;
return ( double ) freq . QuadPart ;
# elif defined __linux || defined __linux__
return 1e9 ;
# elif defined __MACH__ && defined __APPLE__
# elif defined __MACH__ && defined __APPLE__
static double freq = 0 ;
static double freq = 0 ;
if ( freq = = 0 )
if ( freq = = 0 )
@ -834,6 +836,8 @@ double getTickFrequency(void)
freq = sTimebaseInfo . denom * 1e9 / sTimebaseInfo . numer ;
freq = sTimebaseInfo . denom * 1e9 / sTimebaseInfo . numer ;
}
}
return freq ;
return freq ;
# elif defined __unix__
return 1e9 ;
# else
# else
return 1e6 ;
return 1e6 ;
# endif
# endif