From: Bart Van Assche Date: Sun, 21 Sep 2008 11:21:23 +0000 (+0000) Subject: Renamed __sync_add_and_fetch() into sync_add_and_fetch(). X-Git-Tag: svn/VALGRIND_3_4_0~253 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d9e3e0f8634b4e6a057dc3ab13e23d959006f453;p=thirdparty%2Fvalgrind.git Renamed __sync_add_and_fetch() into sync_add_and_fetch(). git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8630 --- diff --git a/drd/tests/atomic_var.c b/drd/tests/atomic_var.c index 31adb8fe39..3133846ad4 100644 --- a/drd/tests/atomic_var.c +++ b/drd/tests/atomic_var.c @@ -15,9 +15,15 @@ /** Only gcc 4.1.0 and later have atomic builtins. */ -#ifndef HAVE_BUILTIN_ATOMIC +#if defined(HAVE_BUILTIN_ATOMIC) static __inline__ -int __sync_add_and_fetch(int* p, int i) +int sync_add_and_fetch(int* p, int i) +{ + return __sync_add_and_fetch(p, i); +} +#else +static __inline__ +int sync_add_and_fetch(int* p, int i) { if (i == 0) return *p; @@ -35,13 +41,13 @@ static int s_y = 0; static void* thread_func_1(void* arg) { s_y = 1; - (void) __sync_add_and_fetch(&s_x, 1); + (void) sync_add_and_fetch(&s_x, 1); return 0; } static void* thread_func_2(void* arg) { - while (__sync_add_and_fetch(&s_x, 0) == 0) + while (sync_add_and_fetch(&s_x, 0) == 0) ; fprintf(stderr, "y = %d\n", s_y); return 0;