Avoiding the Visual C++ Runtime Library
By Matthew Wilson, February 01, 2003
There are many ways in which an app or library may be dependent on the C Runtime Library. But for small executables, most of the library is not required. You can make smaller, more-independent apps with the help of a "mini-CRT" Library.
February 2003/Avoiding the Visual C++ Runtime Library
Listing 10 Initializing constant variables
extern "C"
{
unsigned int _osver;
unsigned int _winver;
unsigned int _winmajor;
unsigned int _winminor;
}
int WINAPI WinMain( ... )
{
_osver = GetVersion();
_winminor = (_osver >> 8) & 0x00FF ;
_winmajor = _osver & 0x00FF ;
_winver = (_winmajor << 8) + _winminor;
_osver = (_osver >> 16) & 0x00FFFF ;
}