[Cmake-commits] CMake branch, next, updated. v3.6.2-2436-g3c6d4f6
Daniel Pfeifer
daniel at pfeifer-mail.de
Fri Sep 23 15:57:10 EDT 2016
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 3c6d4f69016e6ce48430b3d49c63857aaeb14b76 (commit)
via 061e0e1b30ad8db23e9c416c983627c618cb2737 (commit)
via a2bf3ec9f86a3395ba79764167bd44690a379766 (commit)
from b09e900006ba1960ce16f09b73767b9d3a2a171b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3c6d4f69016e6ce48430b3d49c63857aaeb14b76
commit 3c6d4f69016e6ce48430b3d49c63857aaeb14b76
Merge: b09e900 061e0e1
Author: Daniel Pfeifer <daniel at pfeifer-mail.de>
AuthorDate: Fri Sep 23 15:57:08 2016 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Sep 23 15:57:08 2016 -0400
Merge topic 'auto-ptr' into next
061e0e1b Use std::auto_ptr on compilers that do not warn about it
a2bf3ec9 Add a feature check to test availability of auto_ptr
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=061e0e1b30ad8db23e9c416c983627c618cb2737
commit 061e0e1b30ad8db23e9c416c983627c618cb2737
Author: Daniel Pfeifer <daniel at pfeifer-mail.de>
AuthorDate: Fri Sep 23 21:56:34 2016 +0200
Commit: Daniel Pfeifer <daniel at pfeifer-mail.de>
CommitDate: Fri Sep 23 21:56:34 2016 +0200
Use std::auto_ptr on compilers that do not warn about it
diff --git a/Source/cm_auto_ptr.hxx b/Source/cm_auto_ptr.hxx
index f6c4362..f38eda5 100644
--- a/Source/cm_auto_ptr.hxx
+++ b/Source/cm_auto_ptr.hxx
@@ -14,7 +14,13 @@
#include <cmConfigure.h>
-// FIXME: Use std::auto_ptr on compilers that do not warn about it.
+#ifdef CMake_HAVE_CXX_AUTO_PTR
+
+#include <memory>
+#define CM_AUTO_PTR std::auto_ptr
+
+#else
+
#define CM_AUTO_PTR cm::auto_ptr
// The HP compiler cannot handle the conversions necessary to use
@@ -219,3 +225,5 @@ public:
#endif
#endif
+
+#endif
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a2bf3ec9f86a3395ba79764167bd44690a379766
commit a2bf3ec9f86a3395ba79764167bd44690a379766
Author: Daniel Pfeifer <daniel at pfeifer-mail.de>
AuthorDate: Fri Sep 23 21:49:12 2016 +0200
Commit: Daniel Pfeifer <daniel at pfeifer-mail.de>
CommitDate: Fri Sep 23 21:49:12 2016 +0200
Add a feature check to test availability of auto_ptr
diff --git a/Source/Checks/cm_cxx_auto_ptr.cxx b/Source/Checks/cm_cxx_auto_ptr.cxx
new file mode 100644
index 0000000..fc49346
--- /dev/null
+++ b/Source/Checks/cm_cxx_auto_ptr.cxx
@@ -0,0 +1,16 @@
+#include <memory>
+
+std::auto_ptr<int> get_auto_ptr()
+{
+ return std::auto_ptr<int>(new int(0));
+}
+
+int use_auto_ptr(std::auto_ptr<int> ptr)
+{
+ return *ptr;
+}
+
+int main()
+{
+ return use_auto_ptr(get_auto_ptr());
+}
diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake
index c6a532f..83bcff5 100644
--- a/Source/Checks/cm_cxx_features.cmake
+++ b/Source/Checks/cm_cxx_features.cmake
@@ -36,6 +36,7 @@ if(CMAKE_CXX_STANDARD)
if(CMake_HAVE_CXX_MAKE_UNIQUE)
set(CMake_HAVE_CXX_UNIQUE_PTR 1)
endif()
+ cm_check_cxx_feature(auto_ptr)
cm_check_cxx_feature(nullptr)
cm_check_cxx_feature(override)
cm_check_cxx_feature(unique_ptr)
diff --git a/Source/cmConfigure.cmake.h.in b/Source/cmConfigure.cmake.h.in
index 8365367..8a1e81f 100644
--- a/Source/cmConfigure.cmake.h.in
+++ b/Source/cmConfigure.cmake.h.in
@@ -30,6 +30,7 @@
#cmakedefine CMAKE_USE_MACH_PARSER
#cmakedefine CMAKE_USE_LIBUV
#cmakedefine CMAKE_ENCODING_UTF8
+#cmakedefine CMake_HAVE_CXX_AUTO_PTR
#cmakedefine CMake_HAVE_CXX_MAKE_UNIQUE
#cmakedefine CMake_HAVE_CXX_NULLPTR
#cmakedefine CMake_HAVE_CXX_OVERRIDE
-----------------------------------------------------------------------
Summary of changes:
Source/Checks/cm_cxx_auto_ptr.cxx | 16 ++++++++++++++++
Source/Checks/cm_cxx_features.cmake | 1 +
Source/cmConfigure.cmake.h.in | 1 +
Source/cm_auto_ptr.hxx | 10 +++++++++-
4 files changed, 27 insertions(+), 1 deletion(-)
create mode 100644 Source/Checks/cm_cxx_auto_ptr.cxx
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list