Skip to content

Commit

Permalink
expose fr_ptr_to_type
Browse files Browse the repository at this point in the history
  • Loading branch information
alandekok committed May 24, 2017
1 parent b4a3ea9 commit 4ef68f0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/lib/io/time.h
Expand Up @@ -129,6 +129,11 @@ void fr_time_tracking_yield(fr_time_tracking_t *tt, fr_time_t when, fr_time_trac
void fr_time_tracking_resume(fr_time_tracking_t *tt, fr_time_t when) CC_HINT(nonnull);
void fr_time_tracking_debug(fr_time_tracking_t *tt, FILE *fp) CC_HINT(nonnull);

/** Convert a pointer to a member into a pointer to the parent structure.
*
*/
#define fr_ptr_to_type(TYPE, MEMBER, PTR) (TYPE *) (((char *)PTR) - offsetof(TYPE, MEMBER))

#ifdef __cplusplus
}
#endif
Expand Down
2 changes: 0 additions & 2 deletions src/lib/io/worker.c
Expand Up @@ -470,8 +470,6 @@ static void fr_worker_send_reply(fr_worker_t *worker, REQUEST *request, size_t s
}


#define fr_ptr_to_type(TYPE, MEMBER, PTR) (TYPE *) (((char *)PTR) - offsetof(TYPE, MEMBER))

/** Check timeouts on the various queues
*
* This function checks and enforces timeouts on the multiple worker
Expand Down

0 comments on commit 4ef68f0

Please sign in to comment.