Use caa_ prefix for min() and max()
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 2 Aug 2011 17:22:38 +0000 (13:22 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 2 Aug 2011 17:22:38 +0000 (13:22 -0400)
Defining min/max macros clashes with C++.

Reported-by: Vegard Nossum <vegard.nossum@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
urcu-bp.c
urcu/compiler.h

index 39a6cd0e9ab3ffe06f1d96eaeb889f77f692ac89..273acb88cf2d1749e57bb840bc6e78ab414ebf1d 100644 (file)
--- a/urcu-bp.c
+++ b/urcu-bp.c
@@ -295,7 +295,7 @@ static void add_thread(void)
        if (registry_arena.len
            < registry_arena.used + sizeof(struct rcu_reader))
                resize_arena(&registry_arena,
-               max(registry_arena.len << 1, ARENA_INIT_ALLOC));
+               caa_max(registry_arena.len << 1, ARENA_INIT_ALLOC));
        /*
         * Find a free spot.
         */
index 64d12d344a26a1fdca56fd0b1201437241b9967a..54904cc4078ed144f8a25bc4778cea1ef7fd1319 100644 (file)
  */
 #define CMM_ACCESS_ONCE(x)     (*(volatile typeof(x) *)&(x))
 
-#ifndef max
-#define max(a,b) ((a)>(b)?(a):(b))
+#ifndef caa_max
+#define caa_max(a,b) ((a)>(b)?(a):(b))
 #endif
 
-#ifndef min
-#define min(a,b) ((a)<(b)?(a):(b))
+#ifndef caa_min
+#define caa_min(a,b) ((a)<(b)?(a):(b))
 #endif
 
 #if defined(__SIZEOF_LONG__)
This page took 0.027823 seconds and 4 git commands to generate.