What you have is a check to see if the computer uses a large endian or a small end. SDL is multi-platform, and computers use different endiannness.
The author of this article wrote it in an "agnostic" platform. If you use this on a PC, you'll probably be safe just by using:
surface = SDL_CreateRGBSurface(SDL_HWSURFACE,width,height,32, 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000);
You do not need conventions.
However, the code will not be ported to other platforms that use a large endiandess
source share