Skip to content

Commit bba8485

Browse files
committed
patch by Yan Zhou
1 parent 89a3b35 commit bba8485

4 files changed

Lines changed: 44 additions & 1 deletion

File tree

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2012-12-01 Dirk Eddelbuettel <edd@debian.org>
2+
3+
* inst/include/RcppCommon.h: Applied patch by Yan Zhou to add support
4+
for clang++ with libc++, and Intel's icpc when std=c++11
5+
16
2012-11-29 Romain Francois <romain@r-enthusiasts.com>
27

38
* unitTests/runit.DataFrame.R: using sourceCpp

inst/NEWS.Rd

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
\itemize{
77
\item Changes in Rcpp API:
88
\itemize{
9-
\item Added additional check in Rstreambuf deletetion
9+
\item Added additional check in \code{Rstreambuf} deletetion
10+
\item Added support for \code{clang++} when using \code{libc++},
11+
and for anc \code{icpc} in \code{std=c++11} mode, thanks to a
12+
patch by Yan Zhou
1013
}
1114
}
1215
}

inst/THANKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ Luke Tierney for helpful discussions on R internals
2424
Simon Urbanek for help on OS X build issues and with R internals
2525
Ken Williams for additional OS X testing
2626
Jelmer Ypma for contributing the Rcout iostreams class patch
27+
Yan Zhou for a patch to RcppCommon.h extending compiler support

inst/include/RcppCommon.h

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,33 @@ namespace Rcpp{
107107
// #endif
108108
// #endif
109109

110+
// This definition was contributed by Yan Zhou
111+
#ifdef __clang__
112+
#if !__has_include(<tr1/unordered_map>)
113+
#undef HAS_TR1
114+
#undef HAS_TR1_UNORDERED_MAP
115+
#endif
116+
#if !__has_include(<tr1/unordered_set>)
117+
#undef HAS_TR1
118+
#undef HAS_TR1_UNORDERED_SET
119+
#endif
120+
#if __has_feature(cxx_variadic_templates)
121+
#define HAS_VARIADIC_TEMPLATES
122+
#endif
123+
#endif
124+
110125
#ifdef __INTEL_COMPILER
111126
// This is based on an email by Alexey Stukalov who tested
112127
// Intel Compiler 12.0 and states that is does support Cxx0x
113128
// or even TR1 (by default; maybe there are options?)
129+
// Extended further via patch in email by Yan Zhou
114130
#undef HAS_VARIADIC_TEMPLATES
131+
#include <cmath>
132+
#ifndef __GLIBCXX__
115133
#undef HAS_TR1
116134
#undef HAS_TR1_UNORDERED_MAP
117135
#undef HAS_TR1_UNORDERED_SET
136+
#endif
118137
#endif
119138

120139

@@ -149,6 +168,21 @@ namespace Rcpp{
149168
#include <tr1/unordered_set>
150169
#endif
151170

171+
172+
#if __cplusplus >= 201103L
173+
#if defined(__GLIBCXX__) && __GLIBCXX__ > 20090421
174+
#include <unordered_map>
175+
#include <unordered_set>
176+
#elif defined(__clang__)
177+
#if __has_include(<unordered_map>)
178+
#include <unordered_map>
179+
#endif
180+
#if __has_include(<unordered_set>)
181+
#include <unordered_set>
182+
#endif
183+
#endif
184+
#endif
185+
152186
std::string demangle( const std::string& name) ;
153187
#define DEMANGLE(__TYPE__) demangle( typeid(__TYPE__).name() ).c_str()
154188

0 commit comments

Comments
 (0)