[vlc-devel] commit: macosx ppc: this should hopefully fix 49f3721c5baa88feece1d8793f08f08b2ed86a4d ( Derk-Jan Hartman )
git version control
git at videolan.org
Sat Apr 4 02:41:58 CEST 2009
vlc | branch: 0.9-bugfix | Derk-Jan Hartman <hartman at videolan.org> | Sat Apr 4 02:40:49 2009 +0200| [7786caa59f70d40794273cd741ea96f98d43621f] | committer: Derk-Jan Hartman
macosx ppc: this should hopefully fix 49f3721c5baa88feece1d8793f08f08b2ed86a4d
OS X uses __powerpc__ __ppc__ and __ppc64__ depending on the ggc version that you use.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7786caa59f70d40794273cd741ea96f98d43621f
---
include/vlc_threads.h | 6 +++---
src/misc/mtime.c | 12 +++++++-----
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/include/vlc_threads.h b/include/vlc_threads.h
index 4871fcd..8dcdf5a 100644
--- a/include/vlc_threads.h
+++ b/include/vlc_threads.h
@@ -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 ) \
__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 */
#endif
@@ -369,7 +369,7 @@ static inline int __vlc_cond_timedwait( const char * psz_file, int i_line,
mtime_t deadline )
{
#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
* the same base than gettimeofday() on which pthread_cond_timedwait
* counts on. */
@@ -581,7 +581,7 @@ static inline void barrier (void)
__sync_synchronize ();
#elif defined(__APPLE__)
OSMemoryBarrier ();
-#elif defined(__powerpc__)
+#elif defined(__powerpc__) || defined( __ppc__ ) || defined( __ppc64__ )
asm volatile ("sync":::"memory");
#elif 0 // defined(__i386__) /* Requires SSE2 support */
asm volatile ("mfence":::"memory");
diff --git a/src/misc/mtime.c b/src/misc/mtime.c
index 5792c9b..3ee71fd 100644
--- a/src/misc/mtime.c
+++ b/src/misc/mtime.c
@@ -60,7 +60,7 @@
# include <sys/time.h>
#endif
-#if defined(__APPLE__) && !defined(__powerpc__)
+#if defined(__APPLE__) && !defined(__powerpc__) && !defined( __ppc__ ) && !defined( __ppc64__ )
# include <mach/mach.h>
# include <mach/mach_time.h>
#endif
@@ -177,7 +177,7 @@ static inline unsigned mprec( void )
#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 pthread_once_t mtime_timebase_info_once = PTHREAD_ONCE_INIT;
static void mtime_init_timebase(void)
@@ -211,7 +211,7 @@ mtime_t mdate( void )
#elif defined( HAVE_KERNEL_OS_H )
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);
uint64_t date = mach_absolute_time();
@@ -364,7 +364,8 @@ void mwait( mtime_t date )
ts.tv_sec = d.quot; ts.tv_nsec = d.rem * 1000;
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);
uint64_t mach_time = date * 1000 * mtime_timebase_info.denom / mtime_timebase_info.numer;
mach_wait_until(mach_time);
@@ -414,7 +415,8 @@ void msleep( mtime_t delay )
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);
uint64_t mach_time = delay * 1000 * mtime_timebase_info.denom / mtime_timebase_info.numer;
mach_wait_until(mach_time + mach_absolute_time());
More information about the vlc-devel
mailing list