Skip to content

Commit

Permalink
Merge pull request #265 from crobinso/container_of
Browse files Browse the repository at this point in the history
iser: Use local container_of definition
  • Loading branch information
sahlberg authored Apr 30, 2018
2 parents 8d5d0b2 + f1feb21 commit 054528e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/iser.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@
#include <semaphore.h>
#include <poll.h>


#ifndef container_of
/**
* container_of - cast a member of a structure out to the containing structure
* @ptr: the pointer to the member.
* @type: the type of the container struct this is embedded in.
* @member: the name of the member within the struct.
*
*/
#define container_of(ptr, type, member) \
((type *) ((uint8_t *)(ptr) - offsetof(type, member)))
#endif


#ifdef __linux

/* MUST keep in sync with socket.c */
Expand Down

0 comments on commit 054528e

Please sign in to comment.