Add macros for shared pointer cast.