|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r84796 - in trunk: boost/config/compiler libs/config/doc
From: andrey.semashev_at_[hidden]
Date: 2013-06-15 12:40:47
Author: andysem
Date: 2013-06-15 12:40:46 EDT (Sat, 15 Jun 2013)
New Revision: 84796
URL: http://svn.boost.org/trac/boost/changeset/84796
Log:
Added BOOST_HAS_PRAGMA_ONCE for compilers that support it. The macro was already defined for DMC, but not for other compilers and was not documented.
Text files modified:
trunk/boost/config/compiler/borland.hpp | 4 ----
trunk/boost/config/compiler/clang.hpp | 2 ++
trunk/boost/config/compiler/codegear.hpp | 6 ++++++
trunk/boost/config/compiler/common_edg.hpp | 5 +++++
trunk/boost/config/compiler/gcc.hpp | 5 +++++
trunk/boost/config/compiler/visualc.hpp | 4 ++++
trunk/libs/config/doc/macro_reference.qbk | 6 ++++++
7 files changed, 28 insertions(+), 4 deletions(-)
Modified: trunk/boost/config/compiler/borland.hpp
==============================================================================
--- trunk/boost/config/compiler/borland.hpp Sat Jun 15 12:11:37 2013 (r84795)
+++ trunk/boost/config/compiler/borland.hpp 2013-06-15 12:40:46 EDT (Sat, 15 Jun 2013) (r84796)
@@ -283,7 +283,3 @@
#define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
#define BOOST_COMPILER "Borland C++ version " BOOST_STRINGIZE(__BORLANDC__)
-
-
-
-
Modified: trunk/boost/config/compiler/clang.hpp
==============================================================================
--- trunk/boost/config/compiler/clang.hpp Sat Jun 15 12:11:37 2013 (r84795)
+++ trunk/boost/config/compiler/clang.hpp 2013-06-15 12:40:46 EDT (Sat, 15 Jun 2013) (r84796)
@@ -8,6 +8,8 @@
// Clang compiler setup.
+#define BOOST_HAS_PRAGMA_ONCE
+
#if !__has_feature(cxx_exceptions) && !defined(BOOST_NO_EXCEPTIONS)
# define BOOST_NO_EXCEPTIONS
#endif
Modified: trunk/boost/config/compiler/codegear.hpp
==============================================================================
--- trunk/boost/config/compiler/codegear.hpp Sat Jun 15 12:11:37 2013 (r84795)
+++ trunk/boost/config/compiler/codegear.hpp 2013-06-15 12:40:46 EDT (Sat, 15 Jun 2013) (r84796)
@@ -72,6 +72,12 @@
# endif
#endif
+
+// Reportedly, #pragma once is supported since C++ Builder 2010
+#if (__CODEGEARC__ >= 0x620)
+# define BOOST_HAS_PRAGMA_ONCE
+#endif
+
//
// C++0x macros:
//
Modified: trunk/boost/config/compiler/common_edg.hpp
==============================================================================
--- trunk/boost/config/compiler/common_edg.hpp Sat Jun 15 12:11:37 2013 (r84795)
+++ trunk/boost/config/compiler/common_edg.hpp 2013-06-15 12:40:46 EDT (Sat, 15 Jun 2013) (r84796)
@@ -54,6 +54,11 @@
# define BOOST_NO_LONG_LONG
# endif
+// Not sure what version was the first to support #pragma once, but
+// different EDG-based compilers (e.g. Intel) supported it for ages.
+// Add a proper version check if it causes problems.
+#define BOOST_HAS_PRAGMA_ONCE
+
//
// C++0x features
//
Modified: trunk/boost/config/compiler/gcc.hpp
==============================================================================
--- trunk/boost/config/compiler/gcc.hpp Sat Jun 15 12:11:37 2013 (r84795)
+++ trunk/boost/config/compiler/gcc.hpp 2013-06-15 12:40:46 EDT (Sat, 15 Jun 2013) (r84796)
@@ -80,6 +80,11 @@
# endif
#endif
+// GCC prior to 3.4 had #pragma once too but it didn't work well with filesystem links
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+#define BOOST_HAS_PRAGMA_ONCE
+#endif
+
#if __GNUC__ < 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ < 4 )
// Previous versions of GCC did not completely implement value-initialization:
// GCC Bug 30111, "Value-initialization of POD base class doesn't initialize
Modified: trunk/boost/config/compiler/visualc.hpp
==============================================================================
--- trunk/boost/config/compiler/visualc.hpp Sat Jun 15 12:11:37 2013 (r84795)
+++ trunk/boost/config/compiler/visualc.hpp 2013-06-15 12:40:46 EDT (Sat, 15 Jun 2013) (r84796)
@@ -34,6 +34,10 @@
// Attempt to suppress VC6 warnings about the length of decorated names (obsolete):
#pragma warning( disable : 4503 ) // warning: decorated name length exceeded
+#if _MSC_VER >= 1020
+# define BOOST_HAS_PRAGMA_ONCE
+#endif
+
//
// versions check:
// we don't support Visual C++ prior to version 6:
Modified: trunk/libs/config/doc/macro_reference.qbk
==============================================================================
--- trunk/libs/config/doc/macro_reference.qbk Sat Jun 15 12:11:37 2013 (r84795)
+++ trunk/libs/config/doc/macro_reference.qbk 2013-06-15 12:40:46 EDT (Sat, 15 Jun 2013) (r84796)
@@ -397,6 +397,12 @@
The standard library has a partially conforming `std::allocator` class, but
without any of the member templates.
]]
+[[`BOOST_HAS_PRAGMA_ONCE`][Compiler][
+The compiler recognizes the `#pragma once` directive which tells that the
+containing header should be included only once while preprocessing the
+current translation unit. The pragma may improve compile times of large projects
+with some compilers.
+]]
[[`BOOST_HAS_PTHREAD_DELAY_NP`][Platform][
The platform has the POSIX API `pthread_delay_np`.
]]
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk