Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(197)

Unified Diff: third_party/harfbuzz-ng/src/hb-atomic-private.hh

Issue 10510004: Roll harfbuzz-ng 3b8fd9c48f4bde368bf2d465c148b9743a9216ee (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/harfbuzz-ng/src/hb.h ('k') | third_party/harfbuzz-ng/src/hb-blob.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/harfbuzz-ng/src/hb-atomic-private.hh
diff --git a/third_party/harfbuzz-ng/src/hb-glib.h b/third_party/harfbuzz-ng/src/hb-atomic-private.hh
similarity index 50%
copy from third_party/harfbuzz-ng/src/hb-glib.h
copy to third_party/harfbuzz-ng/src/hb-atomic-private.hh
index 3bc3ebf1e7d95629821dbe326202d46e04139b59..d6bd1c93d1ad504e4f0a98ea2b96d3908666f012 100644
--- a/third_party/harfbuzz-ng/src/hb-glib.h
+++ b/third_party/harfbuzz-ng/src/hb-atomic-private.hh
@@ -1,6 +1,7 @@
/*
- * Copyright © 2009 Red Hat, Inc.
- * Copyright © 2011 Google, Inc.
+ * Copyright © 2007 Chris Wilson
+ * Copyright © 2009,2010 Red Hat, Inc.
+ * Copyright © 2011,2012 Google, Inc.
*
* This is part of HarfBuzz, a text shaping library.
*
@@ -22,30 +23,57 @@
* ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*
+ * Contributor(s):
+ * Chris Wilson <chris@chris-wilson.co.uk>
* Red Hat Author(s): Behdad Esfahbod
* Google Author(s): Behdad Esfahbod
*/
-#ifndef HB_GLIB_H
-#define HB_GLIB_H
+#ifndef HB_ATOMIC_PRIVATE_HH
+#define HB_ATOMIC_PRIVATE_HH
+
+#include "hb-private.hh"
+
+
+/* atomic_int */
+
+/* We need external help for these */
+
+#if 0
-#include "hb.h"
-#include <glib.h>
-HB_BEGIN_DECLS
+#elif !defined(HB_NO_MT) && defined(_MSC_VER) && _MSC_VER >= 1600
+#include <intrin.h>
+typedef long hb_atomic_int_t;
+#define hb_atomic_int_add(AI, V) _InterlockedExchangeAdd (&(AI), (V))
-hb_script_t
-hb_glib_script_to_script (GUnicodeScript script);
-GUnicodeScript
-hb_glib_script_from_script (hb_script_t script);
+#elif !defined(HB_NO_MT) && defined(__APPLE__)
+
+#include <libkern/OSAtomic.h>
+typedef int32_t hb_atomic_int_t;
+#define hb_atomic_int_add(AI, V) (OSAtomicAdd32Barrier ((V), &(AI)) - (V))
+
+
+#elif !defined(HB_NO_MT) && defined(HAVE_GLIB)
+
+#include <glib.h>
+typedef volatile int hb_atomic_int_t;
+#if GLIB_CHECK_VERSION(2,29,5)
+#define hb_atomic_int_add(AI, V) g_atomic_int_add (&(AI), (V))
+#else
+#define hb_atomic_int_add(AI, V) g_atomic_int_exchange_and_add (&(AI), (V))
+#endif
+
+#else
-hb_unicode_funcs_t *
-hb_glib_get_unicode_funcs (void);
+#define HB_ATOMIC_INT_NIL 1
+typedef volatile int hb_atomic_int_t;
+#define hb_atomic_int_add(AI, V) (((AI) += (V)) - (V))
+#endif
-HB_END_DECLS
-#endif /* HB_GLIB_H */
+#endif /* HB_ATOMIC_PRIVATE_HH */
« no previous file with comments | « third_party/harfbuzz-ng/src/hb.h ('k') | third_party/harfbuzz-ng/src/hb-blob.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698