From: Mathieu Desnoyers Date: Tue, 2 Aug 2011 17:22:38 +0000 (-0400) Subject: Use caa_ prefix for min() and max() X-Git-Tag: v0.6.5~59^2 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=2f8a5ae7266ad4fb9ba77cfa1b4a7104d0465096;p=urcu.git Use caa_ prefix for min() and max() Defining min/max macros clashes with C++. Reported-by: Vegard Nossum Signed-off-by: Mathieu Desnoyers --- diff --git a/urcu-bp.c b/urcu-bp.c index 39a6cd0..273acb8 100644 --- 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(®istry_arena, - max(registry_arena.len << 1, ARENA_INIT_ALLOC)); + caa_max(registry_arena.len << 1, ARENA_INIT_ALLOC)); /* * Find a free spot. */ diff --git a/urcu/compiler.h b/urcu/compiler.h index 64d12d3..54904cc 100644 --- a/urcu/compiler.h +++ b/urcu/compiler.h @@ -39,12 +39,12 @@ */ #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__)