Compatibility fixes as suggested by Siegbert Debatin.
Various platform compatibility fixes.
Moved some more platform dependencies to common header files. Included a few necessary system headers.
Reduced compile problems on Windows.
This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, select a symbolic revision name using the selection box, or choose 'Use Text Field' and enter a numeric revision.