Boost logo

Boost :

From: François Dumont (francois.cppdevs_at_[hidden])
Date: 2005-08-23 14:19:48


    I am submitting once again this patch for the thread library as the
issue still exist with 1.33.0. When building boost with msvc-stlport
toolset the _snprintf function used at read_write_mutex.cpp:151 is
undefined as stdio.h has not been included next to tchar.h include at
line 38.

    In order to have this patch apply this time I have study why
_snprintf _is_ defined when using msvc toolset. The conclusion is that
the definition comes from the <utility> include in
boost/config/select_stdlib_config.hpp which is used to guess what is the
std lib. In VC6 utility header include a lot of headers indirectly like
cstring, cwchar, xstddef and cstdio which give _snprintf. The STLport
utility try to limit the includes, maybe it shouldn't ;-)

    For your info I discovered an other issue, some guy from boost will
have perhaps to work on it. I have only check it with VC6, don't know if
it is reproductible with .NET 2002 or 2003. Even if you set your INCLUDE
env variable to use the latest PSDK rather than the one integrated in
VC6 you are still include of windows.h from boost during build process
are still referencing the VC6 windows.h rather than the one of the
latest SDK. I thought it was coming from the #include "windows.h" that
exists in many VC6 headers but it is not the case.


*** read_write_mutex.cpp.orig Tue Aug 23 07:46:00 2005
--- read_write_mutex.cpp Tue Aug 23 19:02:08 2005
*** 36,41 ****
--- 36,42 ----
  # include <windows.h>
  # include <tchar.h>
+ # include <stdio.h>
  # if !((_WIN32_WINNT >= 0x0400) || (_WIN32_WINDOWS > 0x0400))
          inline bool IsDebuggerPresent(void)

Boost list run by bdawes at, gregod at, cpdaniel at, john at