Skip to content

Commit

Permalink
[server] Avoid redefining container_of
Browse files Browse the repository at this point in the history
  • Loading branch information
srett committed Jun 7, 2024
1 parent bbb5333 commit 0344ea0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/server/reference.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
#include <stddef.h>
#include <stdint.h>

#ifndef container_of
#define container_of(ptr, type, member) \
((type *)((char *)(ptr) - (char *)&(((type *)NULL)->member)))
#endif

void ref_init( ref *reference, void ( *freefun )( ref * ), long count );

Expand Down

0 comments on commit 0344ea0

Please sign in to comment.