From: Or Gerlitz Date: Sun, 2 Dec 2012 12:04:23 +0000 (+0000) Subject: [librdmacm] Fixed build problem due to missing macro X-Git-Tag: v1.0.17~9 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=c6bfc1c5b15e6207188a97e8a5df0405cfd2587f;p=~shefty%2Flibrdmacm.git [librdmacm] Fixed build problem due to missing macro rsocket.c wasn't passing compilation as of missing definition for the container_of macro, fix it. Reported-by: Eyal Salamon Signed-off-by: Or Gerlitz Signed-off-by: Sean Hefty --- diff --git a/src/cma.c b/src/cma.c index 91bf1084..388be617 100755 --- a/src/cma.c +++ b/src/cma.c @@ -124,11 +124,6 @@ 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) { ucma_ib_cleanup(); diff --git a/src/cma.h b/src/cma.h index 6a1cd752..0a0370ee 100644 --- a/src/cma.h +++ b/src/cma.h @@ -71,6 +71,12 @@ static inline uint64_t ntohll(uint64_t x) { return x; } #define max(a, b) ((a) > (b) ? a : b) #define min(a, b) ((a) < (b) ? a : b) +#ifndef container_of +#define container_of(ptr, type, field) \ + ((type *) ((void *)ptr - offsetof(type, field))) +#endif + + /* * Fast synchronization for low contention locking. */ diff --git a/src/rsocket.c b/src/rsocket.c index 58fcb8e5..a060f66a 100644 --- a/src/rsocket.c +++ b/src/rsocket.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include