-
Couldn't load subscription status.
- Fork 80
chore: Vendor cpp11 headers #451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
pachadotdev
wants to merge
5
commits into
r-dbi:main
Choose a base branch
from
pachadotdev:cpp11_vendoring
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ef622da
vendoring #450
pachadotdev 146034e
move headers to src
pachadotdev 05eac58
https://github.com/r-dbi/RPostgres/pull/451/files#r1387247030
pachadotdev 51fb146
Update src/Makevars.in
pachadotdev 28e8754
Update src/Makevars.win
pachadotdev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,7 +36,6 @@ Suggests: | |
| rmarkdown, | ||
| testthat (>= 3.0.0) | ||
| LinkingTo: | ||
| cpp11, | ||
| plogr (>= 0.2.0) | ||
| VignetteBuilder: | ||
| knitr | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| // cpp11 version: 0.4.6 | ||
| // vendored on: 2023-11-08 | ||
| #pragma once | ||
|
|
||
| #include "cpp11/R.hpp" | ||
| #include "cpp11/altrep.hpp" | ||
| #include "cpp11/as.hpp" | ||
| #include "cpp11/attribute_proxy.hpp" | ||
| #include "cpp11/data_frame.hpp" | ||
| #include "cpp11/doubles.hpp" | ||
| #include "cpp11/environment.hpp" | ||
| #include "cpp11/external_pointer.hpp" | ||
| #include "cpp11/function.hpp" | ||
| #include "cpp11/integers.hpp" | ||
| #include "cpp11/list.hpp" | ||
| #include "cpp11/list_of.hpp" | ||
| #include "cpp11/logicals.hpp" | ||
| #include "cpp11/matrix.hpp" | ||
| #include "cpp11/named_arg.hpp" | ||
| #include "cpp11/protect.hpp" | ||
| #include "cpp11/r_bool.hpp" | ||
| #include "cpp11/r_string.hpp" | ||
| #include "cpp11/r_vector.hpp" | ||
| #include "cpp11/raws.hpp" | ||
| #include "cpp11/sexp.hpp" | ||
| #include "cpp11/strings.hpp" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| // cpp11 version: 0.4.6 | ||
| // vendored on: 2023-11-08 | ||
| #pragma once | ||
|
|
||
| #ifdef R_INTERNALS_H_ | ||
| #if !(defined(R_NO_REMAP) && defined(STRICT_R_HEADERS)) | ||
| #error R headers were included before cpp11 headers \ | ||
| and at least one of R_NO_REMAP or STRICT_R_HEADERS \ | ||
| was not defined. | ||
| #endif | ||
| #endif | ||
|
|
||
| #define R_NO_REMAP | ||
| #define STRICT_R_HEADERS | ||
| #include "Rinternals.h" | ||
|
|
||
| // clang-format off | ||
| #ifdef __clang__ | ||
| # pragma clang diagnostic push | ||
| # pragma clang diagnostic ignored "-Wattributes" | ||
| #endif | ||
|
|
||
| #ifdef __GNUC__ | ||
| # pragma GCC diagnostic push | ||
| # pragma GCC diagnostic ignored "-Wattributes" | ||
| #endif | ||
| // clang-format on | ||
|
|
||
| #include <type_traits> | ||
| #include "cpp11/altrep.hpp" | ||
|
|
||
| namespace cpp11 { | ||
| namespace literals { | ||
|
|
||
| constexpr R_xlen_t operator"" _xl(unsigned long long int value) { return value; } | ||
|
|
||
| } // namespace literals | ||
|
|
||
| namespace traits { | ||
| template <typename T> | ||
| struct get_underlying_type { | ||
| using type = T; | ||
| }; | ||
| } // namespace traits | ||
|
|
||
| template <typename T> | ||
| inline T na(); | ||
|
|
||
| template <typename T> | ||
| inline typename std::enable_if<!std::is_same<typename std::decay<T>::type, double>::value, | ||
| bool>::type | ||
| is_na(const T& value) { | ||
| return value == na<T>(); | ||
| } | ||
|
|
||
| template <typename T> | ||
| inline typename std::enable_if<std::is_same<typename std::decay<T>::type, double>::value, | ||
| bool>::type | ||
| is_na(const T& value) { | ||
| return ISNA(value); | ||
| } | ||
|
|
||
| } // namespace cpp11 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| // cpp11 version: 0.4.6 | ||
| // vendored on: 2023-11-08 | ||
| #pragma once | ||
|
|
||
| #include "Rversion.h" | ||
|
|
||
| #if defined(R_VERSION) && R_VERSION >= R_Version(3, 5, 0) | ||
| #define HAS_ALTREP | ||
| #endif | ||
|
|
||
| #ifndef HAS_ALTREP | ||
|
|
||
| #define ALTREP(x) false | ||
|
|
||
| #define REAL_ELT(x, i) REAL(x)[i] | ||
| #define INTEGER_ELT(x, i) INTEGER(x)[i] | ||
| #define LOGICAL_ELT(x, i) LOGICAL(x)[i] | ||
| #define RAW_ELT(x, i) RAW(x)[i] | ||
|
|
||
| #define SET_REAL_ELT(x, i, val) REAL(x)[i] = val | ||
| #define SET_INTEGER_ELT(x, i, val) INTEGER(x)[i] = val | ||
| #define SET_LOGICAL_ELT(x, i, val) LOGICAL(x)[i] = val | ||
| #define SET_RAW_ELT(x, i, val) RAW(x)[i] = val | ||
|
|
||
| #define REAL_GET_REGION(...) \ | ||
| do { \ | ||
| } while (false) | ||
|
|
||
| #define INTEGER_GET_REGION(...) \ | ||
| do { \ | ||
| } while (false) | ||
| #endif | ||
|
|
||
| #if !defined HAS_ALTREP || (defined(R_VERSION) && R_VERSION < R_Version(3, 6, 0)) | ||
|
|
||
| #define LOGICAL_GET_REGION(...) \ | ||
| do { \ | ||
| } while (false) | ||
|
|
||
| #define RAW_GET_REGION(...) \ | ||
| do { \ | ||
| } while (false) | ||
|
|
||
| #endif |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.