Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timo Koch
dune-common
Commits
ad96f665
Commit
ad96f665
authored
13 years ago
by
Markus Blatt
Browse files
Options
Downloads
Patches
Plain Diff
Only include one header for shared_ptr.
[[Imported from SVN: r6451]]
parent
e1e29a81
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/common/shared_ptr.hh
+2
-7
2 additions, 7 deletions
dune/common/shared_ptr.hh
m4/shared_ptr.m4
+37
-11
37 additions, 11 deletions
m4/shared_ptr.m4
with
39 additions
and
18 deletions
dune/common/shared_ptr.hh
+
2
−
7
View file @
ad96f665
...
...
@@ -5,15 +5,10 @@
#ifndef DUNE_SHARED_PTR_HH
#define DUNE_SHARED_PTR_HH
#if defined HAVE_MEMORY
# include <memory>
#endif
#if defined HAVE_TR1_MEMORY
# include <tr1/memory>
#if defined SHARED_PTR_HEADER
# include SHARED_PTR_HEADER
#endif
#if defined HAVE_BOOST_SHARED_PTR_HPP
# include <boost/shared_ptr.hpp>
#if defined HAVE_BOOST_MAKE_SHARED_HPP
# include <boost/make_shared.hpp>
#endif
...
...
This diff is collapsed.
Click to expand it.
m4/shared_ptr.m4
+
37
−
11
View file @
ad96f665
...
...
@@ -13,7 +13,9 @@ dnl GCC 4.2: namespace: tr1:: #include <tr1/memory>
dnl GCC 4.2: namespace: boost:: #include <boost/shared_ptr.hpp>
dnl
dnl We define one of HAVE_HAVE_TR1_SHARED_PTR or HAVE_BOOST_SHARED_PTR
dnl depending on location, and SHARED_PTR_NAMESPACE to be the namespace in
dnl depending on location, SHARED_PTR_HEADER to be the header with enclosing
dnl brackety braces in which shared_ptr is defined and SHARED_PTR_NAMESPACE to
dnl be the namespace in
dnl which shared_ptr is defined.
dnl
...
...
@@ -30,15 +32,6 @@ dnl AC_REQUIRE([PANDORA_CHECK_CXX_STANDARD])
do
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[
#if defined(HAVE_MEMORY)
# include <memory>
#endif
#if defined(HAVE_TR1_MEMORY)
# include <tr1/memory>
#endif
#if defined(HAVE_BOOST_SHARED_PTR_HPP)
# include <boost/shared_ptr.hpp>
#endif
#include <string>
using $namespace::shared_ptr;
...
...
@@ -48,8 +41,33 @@ shared_ptr<string> test_ptr(new string("test string"));
]])],
[
ac_cv_shared_ptr_namespace="${namespace}"
ac_cv_shared_ptr_header=missing
break
],[ac_cv_shared_ptr_namespace=missing])
],[
ac_cv_shared_ptr_namespace=missing
ac_cv_shared_ptr_header=missing
])
for header in memory tr1/memory boost/shared_ptr.hpp; do
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[
# include <$header>
#include <string>
using $namespace::shared_ptr;
using namespace std;
]],[[
shared_ptr<string> test_ptr(new string("test string"));
]])],
[
ac_cv_shared_ptr_namespace="${namespace}"
ac_cv_shared_ptr_header="<${header}>"
break
],[
ac_cv_shared_ptr_namespace=missing
ac_cv_shared_ptr_header=missing
])
done
if test "$ac_cv_shared_ptr_namespace" != "missing"; then break; fi
done
])
AS_IF([ test "x$ac_cv_shared_ptr_namespace" = xmissing ],
...
...
@@ -60,5 +78,13 @@ shared_ptr<string> test_ptr(new string("test string"));
[The namespace in which SHARED_PTR can be found])
]
)
AS_IF([ test "x$ac_cv_shared_ptr_header" = xmissing ],
[], [
SHARED_PTR_HEADER=${ac_cv_shared_ptr_header}
AC_DEFINE_UNQUOTED([SHARED_PTR_HEADER],
${ac_cv_shared_ptr_header},
[The header in which SHARED_PTR can be found])
]
)
AC_LANG_POP()
])
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment