Carl Daniel said:
The difference here is that the decision to leave long at 32 bits for 64 bit
Windows was based on analysis of 100's of millions of lines of existing code
which showed that leaving long at 32 bits would break less code than
changing it to 64 bits, while the *nix compilers just did what they thought
was "right" and backward compatibility be damned. Both decisions are valid,
but have different ramifications. Both are completely valid and consistent
with the C and C++ standards. The C99 decision to add sized integral types
to the language is really the best answer.
There is no real issue of backward compatibility with precompiled binaries, as
they are linked against 32-bit version of the C library. If you port to a new
platform (i.e. Win64), then a responsible plan will be to test just such a
thing. My opinion, as stated, is that long should be 64-bit. May as well
just remove it for all it is worth now. I seem to recall a time when
Microsoft resisted the move to ANSI C++, mainly because of all the compiler
hacks in place to get MFC to work [and later ATL]. Backward compatibility
with source code seems rather evasive to me as in then end, Microsoft has
always complied with the majority [in this case, just about every other 64-bit
platform defines "long" as 64-bits]. Heck, in C, preprocessor macros are the
name of the game to stay compatible between versions of windows ...