|
From: Dimitri Papadopoulos-O. <pap...@us...> - 2003-09-25 11:28:51
|
Hi, I've searched on Google and everybody seems to agree on the macros that need to be defined to target some Windows version. By combining these, one finds that each of the targets is identified by these respective macros (unless I'm wrong... in which case please correct me): Windows 95 WINVER=0x400 Windows 98 WINVER=0x400 _WIN32_WINDOWS=0x0410 Windows Me WINVER=0x400 _WIN32_WINDOWS=0x0490 Windows NT 4.0 WINVER=0x0400 _WIN32_WINNT=0x0400 Windows NT 4.0 SP3 WINVER=0x0400 _WIN32_WINNT=0x0403 Windows 2000 WINVER=0x500 _WIN32_WINNT=0x0500 Windows XP WINVER=0x501 _WIN32_WINNT=0x0501 Windows Server 2003 WINVER=0x502 _WIN32_WINNT=0x0502 This implies that to distinguish between these groups Windows XP Windows 2000 Windows NT 4.0 Windows 95/98/Me one needs to check _WIN32_WINNT only. In order to distinguish between these groups Windows 95 Windows 98 Windows Me one needs to check _WIN32_WINDOWS only. So indeed it seems WINVER is not needed. Even Microsoft recommend using _WIN32_WINNT and _WIN32_WINDOWS: http://msdn.microsoft.com/library/en-us/sdkintro/sdkintro/using_the_sdk_headers.asp although they sometimes use WINVER: http://msdn.microsoft.com/library/en-us/sdkintro/sdkintro/compiling_source_files.asp There are exceptions though. It's easier to understand #if (WINVER < 0x0500) than #if !(_WIN32_WINNT >= 0x0500) -- Dimitri |