Commit 7786caa5 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

macosx ppc: this should hopefully fix 49f3721c

OS X uses __powerpc__ __ppc__ and __ppc64__ depending on the ggc version that you use.
parent a5353254
...@@ -359,7 +359,7 @@ static inline void __vlc_cond_wait( const char * psz_file, int i_line, ...@@ -359,7 +359,7 @@ static inline void __vlc_cond_wait( const char * psz_file, int i_line,
#define vlc_cond_timedwait( P_COND, P_MUTEX, DEADLINE ) \ #define vlc_cond_timedwait( P_COND, P_MUTEX, DEADLINE ) \
__vlc_cond_timedwait( __FILE__, __LINE__, P_COND, P_MUTEX, DEADLINE ) __vlc_cond_timedwait( __FILE__, __LINE__, P_COND, P_MUTEX, DEADLINE )
#if defined(__APPLE__) && !defined(__powerpc__) #if defined(__APPLE__) && !defined(__powerpc__) && !defined( __ppc__ ) && !defined( __ppc64__ )
# include <sys/time.h> /* gettimeofday in vlc_cond_timedwait */ # include <sys/time.h> /* gettimeofday in vlc_cond_timedwait */
#endif #endif
...@@ -369,7 +369,7 @@ static inline int __vlc_cond_timedwait( const char * psz_file, int i_line, ...@@ -369,7 +369,7 @@ static inline int __vlc_cond_timedwait( const char * psz_file, int i_line,
mtime_t deadline ) mtime_t deadline )
{ {
#if defined(LIBVLC_USE_PTHREAD) #if defined(LIBVLC_USE_PTHREAD)
#if defined(__APPLE__) && !defined(__powerpc__) #if defined(__APPLE__) && !defined(__powerpc__) && !defined( __ppc__ ) && !defined( __ppc64__ )
/* mdate() is mac_absolute_time on osx, which we must convert to do /* mdate() is mac_absolute_time on osx, which we must convert to do
* the same base than gettimeofday() on which pthread_cond_timedwait * the same base than gettimeofday() on which pthread_cond_timedwait
* counts on. */ * counts on. */
...@@ -581,7 +581,7 @@ static inline void barrier (void) ...@@ -581,7 +581,7 @@ static inline void barrier (void)
__sync_synchronize (); __sync_synchronize ();
#elif defined(__APPLE__) #elif defined(__APPLE__)
OSMemoryBarrier (); OSMemoryBarrier ();
#elif defined(__powerpc__) #elif defined(__powerpc__) || defined( __ppc__ ) || defined( __ppc64__ )
asm volatile ("sync":::"memory"); asm volatile ("sync":::"memory");
#elif 0 // defined(__i386__) /* Requires SSE2 support */ #elif 0 // defined(__i386__) /* Requires SSE2 support */
asm volatile ("mfence":::"memory"); asm volatile ("mfence":::"memory");
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
# include <sys/time.h> # include <sys/time.h>
#endif #endif
#if defined(__APPLE__) && !defined(__powerpc__) #if defined(__APPLE__) && !defined(__powerpc__) && !defined( __ppc__ ) && !defined( __ppc64__ )
# include <mach/mach.h> # include <mach/mach.h>
# include <mach/mach_time.h> # include <mach/mach_time.h>
#endif #endif
...@@ -177,7 +177,7 @@ static inline unsigned mprec( void ) ...@@ -177,7 +177,7 @@ static inline unsigned mprec( void )
#endif #endif
} }
#if defined(__APPLE__) && !defined(__powerpc__) #if defined(__APPLE__) && !defined(__powerpc__) && !defined( __ppc__ ) && !defined( __ppc64__ )
static mach_timebase_info_data_t mtime_timebase_info; static mach_timebase_info_data_t mtime_timebase_info;
static pthread_once_t mtime_timebase_info_once = PTHREAD_ONCE_INIT; static pthread_once_t mtime_timebase_info_once = PTHREAD_ONCE_INIT;
static void mtime_init_timebase(void) static void mtime_init_timebase(void)
...@@ -211,7 +211,7 @@ mtime_t mdate( void ) ...@@ -211,7 +211,7 @@ mtime_t mdate( void )
#elif defined( HAVE_KERNEL_OS_H ) #elif defined( HAVE_KERNEL_OS_H )
res = real_time_clock_usecs(); res = real_time_clock_usecs();
#elif defined(__APPLE__) && !defined(__powerpc__) #elif defined(__APPLE__) && !defined(__powerpc__) && !defined( __ppc__ ) && !defined( __ppc64__ )
pthread_once(&mtime_timebase_info_once, mtime_init_timebase); pthread_once(&mtime_timebase_info_once, mtime_init_timebase);
uint64_t date = mach_absolute_time(); uint64_t date = mach_absolute_time();
...@@ -364,7 +364,8 @@ void mwait( mtime_t date ) ...@@ -364,7 +364,8 @@ void mwait( mtime_t date )
ts.tv_sec = d.quot; ts.tv_nsec = d.rem * 1000; ts.tv_sec = d.quot; ts.tv_nsec = d.rem * 1000;
while( clock_nanosleep( CLOCK_REALTIME, 0, &ts, NULL ) == EINTR ); while( clock_nanosleep( CLOCK_REALTIME, 0, &ts, NULL ) == EINTR );
} }
#elif defined(__APPLE__) && !defined(__powerpc__) /* The version that should be used, if it was cancelable */ #elif defined(__APPLE__) && !defined(__powerpc__) && !defined( __ppc__ ) && !defined( __ppc64__ )
/* The version that should be used, if it was cancelable */
pthread_once(&mtime_timebase_info_once, mtime_init_timebase); pthread_once(&mtime_timebase_info_once, mtime_init_timebase);
uint64_t mach_time = date * 1000 * mtime_timebase_info.denom / mtime_timebase_info.numer; uint64_t mach_time = date * 1000 * mtime_timebase_info.denom / mtime_timebase_info.numer;
mach_wait_until(mach_time); mach_wait_until(mach_time);
...@@ -414,7 +415,8 @@ void msleep( mtime_t delay ) ...@@ -414,7 +415,8 @@ void msleep( mtime_t delay )
while( nanosleep( &ts_delay, &ts_delay ) && ( errno == EINTR ) ); while( nanosleep( &ts_delay, &ts_delay ) && ( errno == EINTR ) );
#elif defined( __APPLE__) && !defined(__powerpc__) /* The version that should be used, if it was cancelable */ #elif defined( __APPLE__) && !defined(__powerpc__) && !defined( __ppc__ ) && !defined( __ppc64__ )
/* The version that should be used, if it was cancelable */
pthread_once(&mtime_timebase_info_once, mtime_init_timebase); pthread_once(&mtime_timebase_info_once, mtime_init_timebase);
uint64_t mach_time = delay * 1000 * mtime_timebase_info.denom / mtime_timebase_info.numer; uint64_t mach_time = delay * 1000 * mtime_timebase_info.denom / mtime_timebase_info.numer;
mach_wait_until(mach_time + mach_absolute_time()); mach_wait_until(mach_time + mach_absolute_time());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment