Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#64 Fix detection of Windows NT 4 features

closed
3
2007-05-30
2007-04-26
Jan Echternach
No

Windows NT 4 has InterlockedExchangeAdd() and InterlockedIncrement() with the correct return value, just like Windows 98. But these functions are not used anymore if STLport is compiled for Windows NT 4. That's a side effect of the Windows 95 fixes.

Both Windows NT 4 and Windows 95 use an API version of 0x0400, but for Windows NT 4 it's WINVER == 0x0400 && _WIN32_WINNT == 0x0400 whereas Windows 95 compatibility is selected by WINVER == 0x0400 && _WIN32_WINDOWS == 0x0400. See http://msdn2.microsoft.com/en-us/library/aa383745.aspx for more details.

If only WINVER is defined it means compiling for both the designated Windows NT-based Windows version and the Windows 95-based Windows version. For example, WINVER == 0x0400 && ! defined _WIN32_WINNT && ! defined _WIN32_WINDOWS means compiling for Windows NT 4 and Windows 95. This is not explained at the MSDN web site, but it's what the Windows platform SDK's win32.mak does if TARGETOS=BOTH is set.

The patch defines a new macro _STLP_WINNT4_OR_WIN98 and replaces all uses of _STLP_WIN32_VERSION with _STLP_WINNT4_OR_WIN98. It also moves the version check after the inclusion of the Windows headers because they set the version macros to default values if they hadn't been defined before.

Discussion

1 2 > >> (Page 1 of 2)
  • Logged In: YES
    user_id=615813
    Originator: NO

    Francois, can you see on it?

     
    • priority: 5 --> 3
    • assigned_to: nobody --> dums
     
    • status: open --> pending
     
  • Logged In: YES
    user_id=1096600
    Originator: NO

    Thanks for the explanation. I haven't exactly apply your patch. I preferred to create a _STLP_WIN95 to signal the Windows 95 platform, I have also simplified the macro checks used to detect Windows 95 platform, if you could confirm that it is right it would be great.

    Fix in available in SVN trunk.

    Bests

     
  • Jan Echternach
    Jan Echternach
    2007-05-14

    • status: pending --> open
     
  • Jan Echternach
    Jan Echternach
    2007-05-14

    Logged In: YES
    user_id=1708737
    Originator: YES

    It looks correct except for Windows NT 3.51 and older. Those Windows versions have similarly limited interlocked functions like Windows 95.

     
    • status: open --> pending
     
  • Logged In: YES
    user_id=1096600
    Originator: NO

    I have just submitted an other attempt in SVN trunk, could you double check it ?

    Thanks.

     
  • Jan Echternach
    Jan Echternach
    2007-05-30

    Logged In: YES
    user_id=1708737
    Originator: YES

    No more problems found, it seems to correctly detect both Windows 95 and Windows NT 3 now.

     
1 2 > >> (Page 1 of 2)