I don't want to pick on your patch or anything, but if __WORDSIZE is not defined (may be the case on MSVC, I really don't know) it is defined to 32. But what if MSVC compiles for a 64bit system? Can perhaps someone with experience in MSVC give a hint on how to find out whether we compile for 64bit?
Qt uses
Code: Select all
#if defined(Q_OS_WIN64)
# define QT_POINTER_SIZE 8
#elif defined(Q_OS_WIN32)
# define QT_POINTER_SIZE 4
#endif
and
Code: Select all
#if defined(Q_OS_WIN) && !defined(Q_CC_GNU)
typedef __int64 qint64;Â Â Â Â Â Â /* 64 bit signed */
typedef unsigned __int64 quint64;Â /* 64 bit unsigned */
#else
typedef long long qint64;Â Â Â Â Â Â /* 64 bit signed */
typedef unsigned long long quint64; /* 64 bit unsigned */
#endif
and for QT3_SUPPORT:
Code: Select all
#if defined(Q_OS_WIN64)
typedef __int64 Q_LONG;Â Â Â Â Â Â Â /* word up to 64 bit signed */
typedef unsigned __int64 Q_ULONG;Â Â /* word up to 64 bit unsigned */
#else
typedef long Q_LONG;Â Â Â Â Â Â Â Â /* word up to 64 bit signed */
typedef unsigned long Q_ULONG;Â Â Â /* word up to 64 bit unsigned */
#endif
but I wonder what this really means. (Esp. if the OS is not WIN or the CC is GNU (GCC))
Is long long (and long) on other systems of the same size as a pointer? Probably not, I guess...
I am sorry if this looks like I want to hold your patch back or anything. Really: I'd love to include it! I just need to make sure that this works as intended on all supported systems. And in this case I am not...
EDIT:
I just found /usr/include/SDL/SDL_config_win32.h (which should be simply named SDL_config.h on WIN32/MSVC systems), which seems to tell that uintptr_t and all the other stdint.h types are defined by SDL on Windows systems and
http://www.libsdl.org/release/SDL-devel-1.2.11-VC6.zip seems to prove it. Can someone confirm that this works?