Added user-config macro BOOST_DISABLE_WIN32

(also set in the compiler 's strict mode).
Modified Boost source not to use Win32 specific
extentions in the presence of BOOST_DISABLE_WIN32.


[SVN r13771]
This commit is contained in:
John Maddock
2002-05-09 11:40:52 +00:00
parent 697f09e480
commit d1c3bf73de
9 changed files with 71 additions and 12 deletions

View File

@ -270,6 +270,15 @@ they are listed in the following table:&nbsp;</p>
threading support, even if the compiler in its current
translation mode supports multiple threads.</td>
</tr>
<tr>
<td valign="top">BOOST_DISABLE_WIN32</td>
<td>When defined, disables the use of Win32 specific
API's, even when these are available. Also has the effect
of setting BOOST_DISABLE_THREADS unless
BOOST_HAS_PTHREADS is set. This option may be set
automatically by the config system when it detects that
the compiler is in &quot;strict mode&quot;.</td>
</tr>
</table>
<h4><a name="advanced_config"></a>Advanced configuration usage</h4>

View File

@ -45,16 +45,22 @@
// std::DBL_MAX, as a fix we'll just include float.h and have done with:
#include <float.h>
#endif
//
// __int64:
//
#if __BORLANDC__ >= 0x530
# define BOOST_HAS_MS_INT64
#endif
//
// check for exception handling support:
//
#ifndef _CPPUNWIND
# define BOOST_NO_EXCEPTIONS
#endif
//
// Disable Win32 support in ANSI mode:
//
#pragma defineonoption BOOST_DISABLE_WIN32 -A
#define BOOST_COMPILER "Borland C++ version " BOOST_STRINGIZE(__BORLANDC__)

View File

@ -12,8 +12,11 @@
#if (__COMO_VERSION__ <= 4245) || !defined(BOOST_STRICT_CONFIG)
# if defined(_MSC_VER) && _MSC_VER <= 1300
# define BOOST_NO_STDC_NAMESPACE
# define BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
# define BOOST_NO_SWPRINTF
# if _MSC_VER > 100
// only set this in non-strict mode:
# define BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
# endif
# endif
// Void returns don't work when emulating VC 6 (Peter Dimov)
@ -22,11 +25,24 @@
# define BOOST_NO_VOID_RETURNS
# endif
#endif // version 4245
//
// enable __int64 support in VC emulation mode
// we should also set BOOST_HAS_LONG_LONG when that is
// supported, but there is no way we can detect it:
//
# if defined(_MSC_VER) && (_MSC_VER >= 1200)
# define BOOST_HAS_MS_INT64
# endif
//
// disable win32 support unless we are in VC emulation mode,
// (what does this do to Como on top of Borland?):
//
#if defined(_WIN32) && (_MSC_VER+0 < 1000)
# define BOOST_DISABLE_WIN32
#endif
#define BOOST_COMPILER "Comeau compiler version " BOOST_STRINGIZE(__COMO_VERSION__)

View File

@ -48,7 +48,7 @@
#endif
#ifdef _MSC_VER
#if _MSC_VER+0 >= 1000
# ifndef _NATIVE_WCHAR_T_DEFINED
# define BOOST_NO_INTRINSIC_WCHAR_T
# endif
@ -56,6 +56,8 @@
# define BOOST_HAS_MS_INT64
# endif
# define BOOST_NO_SWPRINTF
#elif defined(_WIN32)
# define BOOST_DISABLE_WIN32
#endif
@ -66,12 +68,12 @@
# error "Compiler not supported or configured - please reconfigure"
#endif
//
// last known and checked version is 500:
#if (BOOST_INTEL_CXX_VERSION > 500)
// last known and checked version is 600:
#if (BOOST_INTEL_CXX_VERSION > 600)
# if defined(BOOST_ASSERT_CONFIG)
# error "Unknown compiler version - please run the configure tests and report the results"
# elif defined(_MSC_VER)
# warning "Unknown compiler version - please run the configure tests and report the results"
# pragma message("Unknown compiler version - please run the configure tests and report the results")
# endif
#endif

View File

@ -76,15 +76,22 @@
//
// __int64 support:
//
#if _MSC_VER >= 1200
#if (_MSC_VER >= 1200) && defined(_MSC_EXTENSIONS)
# define BOOST_HAS_MS_INT64
#endif
//
// long long support:
//
#if _MSC_VER >= 1301
#if (_MSC_VER >= 1301) && defined(_MSC_EXTENSIONS)
# define BOOST_HAS_LONG_LONG
#endif
//
// disable Win32 API's if compiler extentions are
// turned off:
//
#ifndef _MSC_EXTENSIONS
# define BOOST_DISABLE_WIN32
#endif
@ -97,7 +104,7 @@
#error "Compiler not supported or configured - please reconfigure"
#endif
//
// last known and checked version is 1300:
// last known and checked version is 1301:
#if (_MSC_VER > 1301)
# if defined(BOOST_ASSERT_CONFIG)
# error "Unknown compiler version - please run the configure tests and report the results"

View File

@ -24,6 +24,7 @@
# define BOOST_NO_SWPRINTF
#endif
#ifndef BOOST_DISABLE_WIN32
//
// Win32 will normally be using native Win32 threads,
// but there is a pthread library avaliable as an option:
@ -34,3 +35,5 @@
// WEK: Added
#define BOOST_HAS_FTIME
#endif

View File

@ -133,6 +133,16 @@
# define BOOST_NO_SWPRINTF
# endif
//
// If Win32 support is turned off, then we must turn off
// threading support also, unless there is some other
// thread API enabled:
//
#if defined(BOOST_DISABLE_WIN32) && defined(_WIN32) \
&& !defined(BOOST_DISABLE_THREADS) && !defined(BOOST_HAS_PTHREADS)
# define BOOST_DISABLE_THREADS
#endif
//
// Turn on threading support if the compiler thinks that it's in
// multithreaded mode. We put this here because there are only a

View File

@ -61,4 +61,8 @@
// when available:
// #define BOOST_DISABLE_THREADS
// define when you want to disable Win32 specific features
// even when available:
// #define BOOST_DISABLE_WIN32

View File

@ -822,6 +822,8 @@ void print_boost_macros()
{
std::cout << "Boost version " << BOOST_STRINGIZE(BOOST_VERSION) << std::endl;
PRINT_MACRO(BOOST_DECL);
PRINT_MACRO(BOOST_DISABLE_THREADS);
PRINT_MACRO(BOOST_DISABLE_WIN32);
PRINT_MACRO(BOOST_HAS_BETHREADS);
PRINT_MACRO(BOOST_HAS_CLOCK_GETTIME);
PRINT_MACRO(BOOST_HAS_FTIME);
@ -890,7 +892,6 @@ void print_boost_macros()
PRINT_MACRO(BOOST_NO_SWPRINTF);
PRINT_MACRO(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION);
PRINT_MACRO(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS);
PRINT_MACRO(BOOST_DISABLE_THREADS);
PRINT_MACRO(BOOST_NO_USING_TEMPLATE);
PRINT_MACRO(BOOST_NO_VOID_RETURNS);
PRINT_MACRO(BOOST_STD_EXTENSION_NAMESPACE);
@ -920,3 +921,4 @@ int main()