]> git.openfabrics.org - ~shefty/librdmacm.git/commitdiff
librdmacm: Place container_of inside #ifdef
authorSean Hefty <sean.hefty@intel.com>
Sat, 22 Sep 2012 00:16:09 +0000 (17:16 -0700)
committerSean Hefty <sean.hefty@intel.com>
Wed, 3 Oct 2012 22:19:27 +0000 (15:19 -0700)
verbs.h defines container_of.  Only define it if not defined

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
src/cma.c

index d168df67a2beddc6cc47f8943b3d32af8d317ad9..91bf108405c58f9221221858f81db3a13e9cc154 100755 (executable)
--- a/src/cma.c
+++ b/src/cma.c
@@ -124,8 +124,10 @@ static pthread_mutex_t mut = PTHREAD_MUTEX_INITIALIZER;
 static int abi_ver = RDMA_USER_CM_MAX_ABI_VERSION;
 int af_ib_support;
 
+#ifndef container_of
 #define container_of(ptr, type, field) \
        ((type *) ((void *)ptr - offsetof(type, field)))
+#endif
 
 static void ucma_cleanup(void)
 {