Skip to content

Commit e7cad54

Browse files
committed
Unbreak long long by making it (as before) conditional on g++ (or clang) as
well as C++11. The condition can be OR'ed with another suitably-defined variable, but the default has to be off as CRAN compliance has to remain the standard.
1 parent b07f27b commit e7cad54

File tree

3 files changed

+37
-19
lines changed

3 files changed

+37
-19
lines changed

ChangeLog

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,45 @@
1-
2013-09-20 Romain Francois <romain@r-enthusiasts.com>
1+
2013-09-19 Dirk Eddelbuettel <edd@debian.org>
2+
3+
* inst/include/Rcpp/longlong.h: Unbreak long long by making it (as
4+
before) conditional on g++ (or clang) as well as C++11. The condition
5+
can be OR'ed with another suitably-defined variable, but the default
6+
has to be off as CRAN compliance has to remain the standard
7+
8+
2013-09-19 Romain Francois <romain@r-enthusiasts.com>
29

310
* include/Rcpp/longlong.h: isolate all handling of long long
411
in a separate file which we might choose not to include by default
512

6-
2013-09-19 Romain Francois <romain@r-enthusiasts.com>
7-
8-
* include/Rcpp/traits/r_sexptype_traits.h : unsigned int wrapped as REALSXP
9-
long standing feature request from Murray.
13+
* include/Rcpp/traits/r_sexptype_traits.h : unsigned int wrapped as
14+
REALSXP long standing feature request from Murray.
1015
* R/Attributes.R : Added the helper demangle and sizeof functions
1116
* man/demangle.Rd : Documentation for demangle and sizeof
12-
* include/Rcpp/platform/compiler.h : less restritive support of long long
13-
types. But still behind a test for gcc and a test for the availability
14-
of the type, and the __extension__. -pedantic does not warn about it
17+
* include/Rcpp/platform/compiler.h : less restritive support of long
18+
long types. But still behind a test for gcc and a test for the
19+
availability of the type, and the __extension__. -pedantic does not
20+
warn about it
1521

1622
2013-09-18 JJ Allaire <jj@rstudio.org>
1723

18-
* R/Attributes.R: Don't search the inline package as a fallback when loading plugins for the the Rcpp::plugins attribute
24+
* R/Attributes.R: Don't search the inline package as a fallback when
25+
loading plugins for the the Rcpp::plugins attribute
1926

2027
2013-09-18 Romain Francois <romain@r-enthusiasts.com>
2128

22-
* vignettes/Rcpp-package.Rnw: Updating the vignette. Setting attributes to TRUE
23-
by default.
24-
* R/Rcpp.package.skeleton.R: Setting attributes to TRUE by default. This is
25-
what we should encourage people to use.
29+
* vignettes/Rcpp-package.Rnw: Updating the vignette. Setting
30+
attributes to TRUE by default.
31+
* R/Rcpp.package.skeleton.R: Setting attributes to TRUE by
32+
default. This is what we should encourage people to use.
2633
* include/Rcpp/as.h: add as<char> specialization
27-
* include/Rcpp/sugar/functions/diff.h : rework the implementation of diff
28-
so that it works even when we don't know the previous value
29-
* unitTests/runit.sugar.R :
34+
* include/Rcpp/sugar/functions/diff.h : rework the implementation of
35+
diff so that it works even when we don't know the previous value
36+
* unitTests/runit.sugar.R :
3037
* unitTests/cpp/sugar.cpp :
3138
* include/Rcpp/sugar/functions/range.h : factored out of minmax.h
3239
* include/Rcpp/sugar/functions/min.h : factored out of minmax.h
3340
* include/Rcpp/sugar/functions/max.h : factored out of minmax.h
3441
* TODO : 3 less items
35-
42+
3643
2013-09-17 JJ Allaire <jj@rstudio.org>
3744

3845
* R/Attributes.R: Call inlineCxxPlugin and Rcpp.plugin.maker without

inst/NEWS.Rd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@
4848
\code{__LONG_LONG_MAX__} is defined, then we have typedefs
4949
\code{rcpp_long_long_type} and \code{rcpp_ulong_long_type} that are defined
5050
behind a gcc \code{__extension__}. This way, we can create useful
51-
features supporting long long, while having \code{-pedantic} not warn about it.
51+
features supporting long long, while having \code{-pedantic} not
52+
warn about it. Note that this still depends on C++11.
5253
}
5354
\item Changes in Attributes:
5455
\itemize{

inst/include/Rcpp/longlong.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 4 -*-
1+
// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
22
//
33
// longlong.h: Rcpp R/C++ interface class library -- long long support
44
//
@@ -22,6 +22,14 @@
2222
#ifndef RCPP_LONG_LONG_H
2323
#define RCPP_LONG_LONG_H
2424

25+
// This does not work as C++98, our default, has no long long support.
26+
// So we are wrapping another layer of C++11 test around it. Feel free
27+
// to add a boolean OR with another suitably #define'd variable which
28+
// has to be OFF by default to restore the old behaviour.
29+
30+
#ifdef __GNUC__
31+
#if defined(__GXX_EXPERIMENTAL_CXX0X__) || (defined (__clang__) && defined(__LP64__))
32+
2533
// long long and unssigned long long support.
2634
//
2735
// given the current restriction of what might go to CRAN
@@ -71,5 +79,7 @@ namespace traits{
7179
}
7280
#endif
7381

82+
#endif
83+
#endif
7484

7585
#endif

0 commit comments

Comments
 (0)