From: Pierre d'Herbemont Date: Fri, 19 Sep 2008 21:59:26 +0000 (+0200) Subject: Use OSAtomic() as a fallback on Mac OS X. X-Git-Tag: 1.0.0-pre1~3100 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=16903a1bbb9a15e718f3c63daa2b7972b9f83dc6;p=vlc Use OSAtomic() as a fallback on Mac OS X. --- diff --git a/po/Makefile.in.in b/po/Makefile.in.in index 13256d8618..fecf500f3f 100644 --- a/po/Makefile.in.in +++ b/po/Makefile.in.in @@ -166,8 +166,6 @@ $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed --msgid-bugs-address="$$msgid_bugs_address" \ ;; \ esac - sed 's/&/\&/' $(DOMAIN).po > $(DOMAIN).po1 && \ - mv $(DOMAIN).po1 $(DOMAIN).po; test ! -f $(DOMAIN).po || { \ if test -f $(srcdir)/$(DOMAIN).pot; then \ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ diff --git a/src/libvlc.c b/src/libvlc.c index b67cf89c3a..07e25d3b30 100644 --- a/src/libvlc.c +++ b/src/libvlc.c @@ -98,6 +98,10 @@ #include +#ifdef __APPLE__ +# include +#endif + #include /***************************************************************************** @@ -127,6 +131,8 @@ void *vlc_gc_init (gc_object_t *p_gc, void (*pf_destruct) (gc_object_t *)) p_gc->refs = 1; #ifdef USE_SYNC __sync_synchronize (); +#elif defined(__APPLE__) + OSMemoryBarrier (); #else /* Nobody else can possibly lock the spin - it's there as a barrier */ vlc_spin_init (&p_gc->spin); @@ -148,6 +154,8 @@ void *vlc_hold (gc_object_t * p_gc) #ifdef USE_SYNC refs = __sync_fetch_and_add (&p_gc->refs, 1); +#elif defined(__APPLE__) + OSAtomicIncrement32Barrier((int*)&p_gc->refs); #else vlc_spin_lock (&p_gc->spin); refs = p_gc->refs++; @@ -169,6 +177,8 @@ void vlc_release (gc_object_t *p_gc) #ifdef USE_SYNC refs = __sync_fetch_and_sub (&p_gc->refs, 1); +#elif defined(__APPLE__) + OSAtomicDecrement32Barrier((int*)&p_gc->refs); #else vlc_spin_lock (&p_gc->spin); refs = p_gc->refs--;