“Aside from being ugly, the code above is wrong.”
Reading four bytes off the wire should be trivial. In C it is a minefield of undefined behavior that compilers exploit for benchmark points. The macro soup most projects use is wrong. The correct version is one line of shifts and masks that nobody gets taught.