]> git.pld-linux.org Git - packages/gtk-webkit4.git/blob - sync-builtins.patch
- fix arg pointer usage
[packages/gtk-webkit4.git] / sync-builtins.patch
1 --- webkitgtk-2.0.0/configure.ac.orig   2013-04-12 08:25:14.896829422 +0200
2 +++ webkitgtk-2.0.0/configure.ac        2013-04-12 08:27:21.244776999 +0200
3 @@ -32,6 +32,18 @@
4  AM_INIT_AUTOMAKE([foreign subdir-objects dist-xz no-dist-gzip tar-ustar])
5  m4_include([Source/autotools/SetupAutomake.m4])
6  
7 +dnl Check whether the target supports 64-bit __sync_*_compare_and_swap.
8 +AC_TRY_LINK([#include <stdint.h>],
9 +    [uint64_t foo, bar;
10 +     bar = __sync_val_compare_and_swap(&foo, 0, 1);],
11 +     wtf_cv_have_64bit_sync_builtins=yes,
12 +     wtf_cv_have_64bit_sync_builtins=no)
13 +
14 +if test $wtf_cv_have_64bit_sync_builtins = yes; then
15 +    AC_DEFINE(HAVE_64BIT_SYNC_BUILTINS, 1,
16 +              [Define to 1 if the target supports 64-bit __sync_*_compare_and_swap])
17 +fi
18 +
19  ######################################################################################
20  # Processing of configuration files
21  ######################################################################################
22 --- webkitgtk-2.0.0/Source/WTF/wtf/Atomics.h~   2013-04-12 08:05:55.951740895 +0200
23 +++ webkitgtk-2.0.0/Source/WTF/wtf/Atomics.h    2013-04-12 08:22:46.701992338 +0200
24 @@ -113,8 +113,16 @@
25  inline int atomicIncrement(int volatile* addend) { return __sync_add_and_fetch(addend, 1); }
26  inline int atomicDecrement(int volatile* addend) { return __sync_sub_and_fetch(addend, 1); }
27  
28 +#ifdef HAVE_64BIT_SYNC_BUILTINS
29  inline int64_t atomicIncrement(int64_t volatile* addend) { return __sync_add_and_fetch(addend, 1); }
30  inline int64_t atomicDecrement(int64_t volatile* addend) { return __sync_sub_and_fetch(addend, 1); }
31 +#else
32 +#include <pthread.h>
33 +static pthread_mutex_t global_wtf_lock = PTHREAD_MUTEX_INITIALIZER;
34 +
35 +inline int64_t atomicIncrement(int64_t volatile* addend) { pthread_mutex_lock(&global_wtf_lock); *addend++; pthread_mutex_unlock(&global_wtf_lock); return *addend; }
36 +inline int64_t atomicDecrement(int64_t volatile* addend) { pthread_mutex_lock(&global_wtf_lock); *addend--; pthread_mutex_unlock(&global_wtf_lock); return *addend; }
37 +#endif
38  
39  #endif
40  
This page took 0.064693 seconds and 3 git commands to generate.