You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/11/08 15:00:31 UTC

[GitHub] andrzej-kaczmarek commented on a change in pull request #1508: kernel/os: Add helper CONTAINER_OF macro

andrzej-kaczmarek commented on a change in pull request #1508: kernel/os: Add helper CONTAINER_OF macro
URL: https://github.com/apache/mynewt-core/pull/1508#discussion_r231922394
 
 

 ##########
 File path: kernel/os/include/os/util.h
 ##########
 @@ -26,4 +26,8 @@
 #define POINTER_TO_INT(p) ((int) ((intptr_t) (p)))
 #define INT_TO_POINTER(u) ((void *) ((intptr_t) (u)))
 
+/* Helper to retrieve pointer to "parent" object in structure */
+#define CONTAINER_OF(ptr, type, field) \
 
 Review comment:
   I also considered it as a lowercase for the same reason and also this is how it's defined in Linux kernel - but since it's still not full consistent with `offsetof` (i.e. without underscore) I eventually did this as in Zephyr which has the advantage that we port some code from there so there will be less changes required :-)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services