diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/internal/slibtool_driver_impl.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/internal/slibtool_driver_impl.h b/src/internal/slibtool_driver_impl.h index f79f9e3..19549ad 100644 --- a/src/internal/slibtool_driver_impl.h +++ b/src/internal/slibtool_driver_impl.h @@ -84,4 +84,16 @@ struct slbt_unit_ctx_impl { struct slbt_unit_ctx uctx; }; +static inline struct slbt_driver_ctx_impl * slbt_get_driver_ictx(const struct slbt_driver_ctx * dctx) +{ + uintptr_t addr; + + if (dctx) { + addr = (uintptr_t)dctx - offsetof(struct slbt_driver_ctx_impl,ctx); + return (struct slbt_driver_ctx_impl *)addr; + } + + return 0; +} + #endif |