Skip to content

Commit 55bd98a

Browse files
committed
added two simple plugins for c++0x and c++11y, respectively
1 parent f85e51c commit 55bd98a

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2014-04-30 Dirk Eddelbuettel <[email protected]>
2+
3+
* R/Attributes.R: Add plugins for C++0x and C++1y
4+
15
2014-04-30 JJ Allaire <[email protected]>
26

37
* R/Attributes.R: Use USE_CXX1X for cpp11 plugin when R >= 3.1

R/Attributes.R

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,19 @@ compileAttributes <- function(pkgdir = ".", verbose = getOption("verbose")) {
393393
# built-in C++11 plugin
394394
.plugins[["cpp11"]] <- function() {
395395
if (getRversion() >= "3.1")
396-
list(env = list(USE_CXX1X = ""))
396+
list(env = list(USE_CXX1X = ""))
397397
else
398-
list(env = list(PKG_CXXFLAGS ="-std=c++11"))
398+
list(env = list(PKG_CXXFLAGS ="-std=c++11"))
399+
}
400+
401+
# built-in C++11 plugin for older g++ compiler
402+
.plugins[["cpp0x"]] <- function() {
403+
list(env = list(PKG_CXXFLAGS ="-std=c++0x"))
404+
}
405+
406+
# built-in C++1y plugin for C++14 and C++17 standard under development
407+
.plugins[["cpp1y"]] <- function() {
408+
list(env = list(PKG_CXXFLAGS ="-std=c++1y"))
399409
}
400410

401411
## built-in OpenMP++11 plugin

inst/NEWS.Rd

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
parser. This allows the parser to handle C++ source files
1313
containing comments inline with function arguments.
1414
\item The \code{USE_CXX1X} environment variable is now defined by
15-
the cpp11 plugin when R >= 3.1
15+
the cpp11 plugin when R >= 3.1. Two additional plugins have been
16+
added for use with C++0x (eg when using g++ 4.6.* as on Windows)
17+
as well as C++1y for compilers beginning to support the next
18+
revision of the stanard.
1619
}
1720
}
1821

0 commit comments

Comments
 (0)