public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Small include/atomic.h cleanup
@ 2009-05-12  8:08 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2009-05-12  8:08 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: Glibc hackers

Hi!

While looking at catomic_* definitions I've noticed that even if
bits/atomic.h defined catomic_compare_and_exchange_val_acq, include/atomic.h
would override it anyway.

2009-05-12  Jakub Jelinek  <jakub@redhat.com>

	* include/atomic.h: Formatting.
	(catomic_compare_and_exchange_val_acq): Don't define if already
	defined by bits/atomic.h.

--- libc/include/atomic.h.jj	2009-02-16 14:47:25.000000000 +0100
+++ libc/include/atomic.h	2009-05-12 09:58:22.000000000 +0200
@@ -95,14 +95,15 @@
 #endif
 
 
-#if !defined catomic_compare_and_exchange_val_acq \
-    && defined __arch_c_compare_and_exchange_val_32_acq
-# define catomic_compare_and_exchange_val_acq(mem, newval, oldval) \
+#ifndef catomic_compare_and_exchange_val_acq
+# ifdef __arch_c_compare_and_exchange_val_32_acq
+#  define catomic_compare_and_exchange_val_acq(mem, newval, oldval) \
   __atomic_val_bysize (__arch_c_compare_and_exchange_val,acq,		      \
 		       mem, newval, oldval)
-#else
-# define catomic_compare_and_exchange_val_acq(mem, newval, oldval) \
+# else
+#  define catomic_compare_and_exchange_val_acq(mem, newval, oldval) \
   atomic_compare_and_exchange_val_acq (mem, newval, oldval)
+# endif
 #endif
 
 
@@ -125,8 +126,8 @@
 #  define atomic_compare_and_exchange_bool_acq(mem, newval, oldval) \
   __atomic_bool_bysize (__arch_compare_and_exchange_bool,acq,		      \
 		        mem, newval, oldval)
-#  else
-#   define atomic_compare_and_exchange_bool_acq(mem, newval, oldval) \
+# else
+#  define atomic_compare_and_exchange_bool_acq(mem, newval, oldval) \
   ({ /* Cannot use __oldval here, because macros later in this file might     \
 	call this macro with __oldval argument.	 */			      \
      __typeof (oldval) __atg3_old = (oldval);				      \
@@ -142,8 +143,8 @@
 #  define catomic_compare_and_exchange_bool_acq(mem, newval, oldval) \
   __atomic_bool_bysize (__arch_c_compare_and_exchange_bool,acq,		      \
 		        mem, newval, oldval)
-#  else
-#   define catomic_compare_and_exchange_bool_acq(mem, newval, oldval) \
+# else
+#  define catomic_compare_and_exchange_bool_acq(mem, newval, oldval) \
   ({ /* Cannot use __oldval here, because macros later in this file might     \
 	call this macro with __oldval argument.	 */			      \
      __typeof (oldval) __atg4_old = (oldval);				      \

	Jakub

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-05-12  8:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-12  8:08 [PATCH] Small include/atomic.h cleanup Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).