]> git.openfabrics.org - ~shefty/librdmacm.git/commitdiff
[librdmacm] Fixed build problem due to missing macro
authorOr Gerlitz <ogerlitz@mellanox.com>
Sun, 2 Dec 2012 12:04:23 +0000 (12:04 +0000)
committerSean Hefty <sean.hefty@intel.com>
Mon, 3 Dec 2012 19:30:29 +0000 (11:30 -0800)
rsocket.c wasn't passing compilation as of missing definition for the
container_of macro, fix it. Reported-by: Eyal Salamon <esalomon@mellanox.com>

Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
src/cma.c
src/cma.h
src/rsocket.c

index 91bf108405c58f9221221858f81db3a13e9cc154..388be617ba7dafc42cef8082ef67d1e81f3d23bb 100755 (executable)
--- 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();
index 6a1cd7520bea3f897b7179fcf0948360815f81ee..0a0370eeed0ea2d1ef911f4c545f80303a861869 100644 (file)
--- 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.
  */
index 58fcb8e583234b87e3e992375bee14bb4595a557..a060f66a245b259a05f1bed46571f501bdf906c2 100644 (file)
@@ -43,6 +43,7 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <stdio.h>
+#include <stddef.h>
 #include <string.h>
 #include <netinet/in.h>
 #include <netinet/tcp.h>