|
Boost : |
From: Sohail Somani (s.somani_at_[hidden])
Date: 2007-01-03 14:44:21
Any opinions on this? It is a patch against 1.33.1. It is meant to be
non-intrusive: nothing should change unless you want it to. The idea is
that when building boost threads, you require language extensions via
your silence on BOOST_NO_REQUIRE_LANGUAGE_EXTENSIONS but if you are not
building boost threads, you don't need language extensions. The idea is
that BOOST_DISABLE_WIN32 does not need to be defined if language
extensions are not needed.
I would appreciate any feedback towards a possible patch. I am currently
running the boost thread tests and hoping that they don't fail ;) If all
goes well, I will rebuild the rest of boost as well and run tests there.
Index: boost/config/compiler/visualc.hpp
===================================================================
--- boost/config/compiler/visualc.hpp (revision 322)
+++ boost/config/compiler/visualc.hpp (working copy)
@@ -99,7 +99,7 @@
// disable Win32 API's if compiler extentions are
// turned off:
//
-#ifndef _MSC_EXTENSIONS
+#if !defined(_MSC_EXTENSIONS) &&
!defined(BOOST_NO_REQUIRE_LANGUAGE_EXTENSIONS)
# define BOOST_DISABLE_WIN32
#endif
Index: boost/thread/detail/config.hpp
===================================================================
--- boost/thread/detail/config.hpp (revision 322)
+++ boost/thread/detail/config.hpp (working copy)
@@ -15,8 +15,20 @@
#include <boost/config.hpp>
// insist on threading support being available:
+// Don't need language extensions if we are not building boost
+// threads
+#if defined(BOOST_MSVC) && !defined(BOOST_BUILDING_THREADS)
+# define BOOST_NO_REQUIRE_LANGUAGE_EXTENSIONS
+# define DEFINED_BOOST_NO_REQUIRE_LANGUAGE_EXTENSIONS
+#endif
+
#include <boost/config/requires_threads.hpp>
+#if defined(DEFINED_BOOST_NO_REQUIRE_LANGUAGE_EXTENSIONS)
+# undef BOOST_NO_REQUIRE_LANGUAGE_EXTENSIONS
+# undef DEFINED_BOOST_NO_REQUIRE_LANGUAGE_EXTENSIONS
+#endif
+
#if defined(BOOST_THREAD_BUILD_DLL) //Build dll
#elif defined(BOOST_THREAD_BUILD_LIB) //Build lib
#elif defined(BOOST_THREAD_USE_DLL) //Use dll
Index: libs/thread/build/threads.jam
===================================================================
--- libs/thread/build/threads.jam (revision 322)
+++ libs/thread/build/threads.jam (working copy)
@@ -63,6 +63,7 @@
: ## requirements ##
<sysinclude>$(BOOST_ROOT)
<threading>multi
+ <define>BOOST_BUILDING_THREADS=1
<borland><*><cxxflags>-w-8004
<borland><*><cxxflags>-w-8057
: ## default build ##
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk