bitcoin/bitcoin — pull request #949 by laanwj (2012-03-18 22:58:08+00:00)
Title: VC2010 compile fixes

I spent some time today trying to get Bitcoin to compile with VC2010. Eventually got it to work nicely. I'll publish the solution and build files this week.

However there were quite some surprises:

- Define `WIN32_LEAN_AND_MEAN` in serialize.h to prevent winsock compile errors.
- CService::GetPort, was mysterious unresolved external. Turned out to be a macro issue, windows defines SetPort
- strprintf problem: http://stackoverflow.com/questions/222195/are-there-gotchas-using-varargs-with-reference-parameters
- works in g++, but in MSVC causes horrible crashes.
- `NOMINMAX` needs to be defined before include of windows.h to prevent windows from defining min and max macros, and std::min and std::max from causing compile errors
- `pid_t` needs to be defined for compatibility

All these are fixed in this patch. The changes are trivial.

This still builds in Linux, however I still need to test whether this doesn't break the gitian cross-compile.