It depends on the combination of compiler, processor and OS.
For instance, on a 64 bit Intel CPU, in 64 bit mode, the size of a long int
in Windows is 4 byte while in Linux and on the Mac it is 8 byte. int
is 4 bytes in all three OSes on Intel.
The compiler implementer also has a choice, but usually uses what the OS uses. But it could well be that a compiler vendor that has C compilers for all three platforms decides to use the same sizes in all three.
Of course, it doesn't make sense to make int
4 bytes (although it would be possible) on a 16 bit CPU.
So it depends on all three things you mention.