]> git.sesse.net Git - vlc/commitdiff
Use OSAtomic() as a fallback on Mac OS X.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Fri, 19 Sep 2008 21:59:26 +0000 (23:59 +0200)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Fri, 19 Sep 2008 23:12:00 +0000 (01:12 +0200)
po/Makefile.in.in
src/libvlc.c

index 13256d86184ab70b2134d0ab8c72e19718061cff..fecf500f3f37c31654b70b48e2e3a7e5f39d11d7 100644 (file)
@@ -166,8 +166,6 @@ $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
              --msgid-bugs-address="$$msgid_bugs_address" \
            ;; \
        esac
-       sed 's/&amp;/\&/' $(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 && \
index b67cf89c3a68c20fd95564c7c6c38d76fa93a889..07e25d3b3013f21b9e3568833143a57cc04934e1 100644 (file)
 
 #include <vlc_vlm.h>
 
+#ifdef __APPLE__
+# include <libkern/OSAtomic.h>
+#endif
+
 #include <assert.h>
 
 /*****************************************************************************
@@ -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--;