I\'m not a C++ developer, but I\'ve always been interested in compilers, and I\'m interested in tinkering with some of the GCC stuff (particularly LLVM).
On Windows,
POSIX (Portable Operating System Interface) "is an evolving, growing document that is being produced by IEEE and standardized by ANSI and ISO. The goal of POSIX is the source-code portability of application" [1].
In practical terms, the goal is defined as the ability to write one source implementation and have it run on different (POSIX-compliant) systems with only recompilation.
GCC is a compiler capable of delivering that promise and as such, it needs a layer of code that brings a machine "up to" POSIX standards.
That is the core of the answer to your question.
To help see what I mean, I'll offer you this exercise:
I think you will find that it is very difficult to write code that uses only the native WIN32 API that compiles on any UNIX or LINUX system
It will be only slightly less difficult to write code that uses POSIX API - as you can on any LINUX box - and have it compile under Windows (DevStudio2005 has a surprising number of POSIX-compliant headers now...you might be able to get close).
Take you LINUX program from above and now compile it under GCC running under Cygwin or MinGW. I'll bet it compiles and runs.
How did GCC perform that bit of magic? The POSIX headers and implementations underlying them provided by Cygwin or MinGW.
Does GCC's reliance on Cygwin/MinGW under Windows make more sense now?