Just wanted to say that technically the way casey implemented offsetof himself on stream is not portable. If you check stddef.h, you might or might not see exactly what casey wrote, but that doesn't mean that it is portable.
The people that wrote stddef.h know whether it is ok to dereference a null pointer like that for that specific compiler, so it is ok for them to use it. But for a newer version of the compiler that might change, and they might change the implementation of offsetof.
For gcc for example there is a builtin compiler keyword for offsetof, which is being used inside stddef.h.
My point is, the same piece of code is ok inside stddef.h, but in your usage code it isn't portable, if you want the code to work with different compilers.
Also technically it is undefined behavior according to the standard, so implementing it yourself is making use of an undocumented compiler "feature".
I'm not saying that it is bad to implement offsetof yourself, just wanted you to know what implications it has if you decide to do so :)