[test] CodeWarrior+IsDebuggerPresent()

Many tests on CW fail due to a missing IsDebuggerPresent() in execution_monitor.ipp. I assume this code should be disabled for CW, no? http://tinyurl.com/59vnj ### mwcc Compiler: # In: ..\boost\test\impl\execution_monitor.ipp # From: ..\libs\logic\test\tribool_io_test.cpp # ----------------------------------------------- # 199: if( IsDebuggerPresent() ) # Error: ^ # undefined identifier 'IsDebuggerPresent' Stefan

In article <d2avm1$at4$1@sea.gmane.org>, Stefan Slapeta <stefan@slapeta.com> wrote:
Many tests on CW fail due to a missing IsDebuggerPresent() in execution_monitor.ipp. I assume this code should be disabled for CW, no?
They never ported that API to Mac OS X as far as I know, so you should feel free to turn it off. meeroh

Gennadiy Rozental wrote:
What is a proper check for this?
naive suggestion: @@ -196,8 +196,10 @@ using unit_test::const_string; #if defined(BOOST_MS_STRCTURED_EXCEPTION_HANDLING) && !defined(__BORLANDC__) +#ifndef __MWERKS__ if( IsDebuggerPresent() ) catch_system_errors = false; +#endif if( catch_system_errors ) _set_se_translator( detail::ms_se_trans_func ); Stefan

naive suggestion:
@@ -196,8 +196,10 @@ using unit_test::const_string;
#if defined(BOOST_MS_STRCTURED_EXCEPTION_HANDLING) && !defined(__BORLANDC__) +#ifndef __MWERKS__ if( IsDebuggerPresent() ) catch_system_errors = false; +#endif
Did you see: http://lists.boost.org/MailArchives/boost/msg80817.php Gennadiy

Gennadiy Rozental wrote:
Did you see:
ok - I'm very sorry for the confusion, I obviously forgot about this thread! As an excuse [:-)], I've investigated the situation. See execution_monitor.ipp: #define BOOST_MS_STRCTURED_EXCEPTION_HANDLING #if !defined(_WIN32_WINNT) #define _WIN32_WINNT 0x0400 #endif #include <wtypes.h> #include <winbase.h> The problem is that winbase.h is already included before by the <locale> header _without_ the definition for _WIN32_WINNT. That's why IsDebuggerPresent() is finally missing! The only solution I can imagine to solve this is to set _WIN32_WINNT globally in CW's bjam settings. Stefan

Stefan Slapeta wrote:
The only solution I can imagine to solve this is to set _WIN32_WINNT globally in CW's bjam settings.
FYI, the behaviour is the same with other compilers: boost.test fails to compile if you include windows.h prior to the boost.test headers! (and if you didn't define _WIN32_WINNT, of course) IsDebuggerPresent() is not implemented in windows 95, I really don't know which strategy is to embark here. Stefan

#define BOOST_MS_STRCTURED_EXCEPTION_HANDLING #if !defined(_WIN32_WINNT) #define _WIN32_WINNT 0x0400 #endif
#include <wtypes.h> #include <winbase.h>
The problem is that winbase.h is already included before by the <locale> header _without_ the definition for _WIN32_WINNT. That's why IsDebuggerPresent() is finally missing!
So you are saying that CW 9.4 uses <locale> that include winbase.h, while the one that is used by CW 8.1 uses <locale> that doesn't? What should I do to make offline library compile without errors? Should I move STL includes? Gennadiy

So you are saying that CW 9.4 uses <locale> that include winbase.h, while the one that is used by CW 8.1 uses <locale> that doesn't?
I don't know what CW 8 does but CW 9.4 does as you say.
What should I do to make offline library compile without errors? Should I move STL includes?
The only idea I have is to set _WIN32_WINNT to 0x0400 globally in the jamfiles. Stefan
participants (4)
-
Gennadiy Rozental
-
Miro Jurisic
-
Peter Dimov
-
Stefan Slapeta