Skip to content

Commit

Permalink
abseil 2023.8.2.1
Browse files Browse the repository at this point in the history
*   Import Abseil LTS version 20230802.1.
*   abseil-cpp changes:
        https://github.com/abseil/abseil-cpp/releases/tag/20230802.1
  • Loading branch information
doccstat committed Oct 1, 2023
1 parent 4969fb6 commit 1380a50
Show file tree
Hide file tree
Showing 11 changed files with 68 additions and 10 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
^docs$
^pkgdown$
^\.github$
^.vscode$
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: abseil
Title: 'C++' Header Files from 'Abseil'
Version: 2023.8.2.0
Version: 2023.8.2.1
Authors@R: c(
person("Xingchi", "Li", , "anthony.li@stat.tamu.edu", role = c("ctb", "cre", "cph"),
comment = c(ORCID = "0009-0006-2493-0853")),
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# abseil 2023.8.2.1

* Import Abseil LTS version 20230802.1.
* abseil-cpp changes:
https://github.com/abseil/abseil-cpp/releases/tag/20230802.1

# abseil 2023.8.2.0

* Import Abseil LTS version 20230802.0
Expand Down
1 change: 1 addition & 0 deletions R/abseil.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
#' return absl::StrJoin(v, "-");
#' }
#' }", depends = "abseil")
#'
#' joinString()
NULL
15 changes: 14 additions & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,28 @@ devtools::install_github("doccstat/abseil-r")

## Example

```{r eval = FALSE}
<details open>

<summary>Directly usage in R</summary>

```{r}
Rcpp::cppFunction(r"{
#include "absl/strings/str_join.h"
std::string joinString() {
std::vector<std::string> v = {"foo","bar","baz"};
return absl::StrJoin(v, "-");
}
}", depends = "abseil")
joinString()
```

</details>

<details close>

<summary>Usage in Rcpp package</summary>

``` cpp
#include <Rcpp.h>
#include "absl/strings/str_join.h"
Expand All @@ -87,6 +98,8 @@ std::string joinString() {
Bare minimum R package using the `abseil` package can be found at
[doccstat/abseil-r-example](https://github.com/doccstat/abseil-r-example).

</details>

## Authors

Abseil Team, Xingchi Li
Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ devtools::install_github("doccstat/abseil-r")

## Example

<details open>
<summary>
Directly usage in R
</summary>

``` r
Rcpp::cppFunction(r"{
#include "absl/strings/str_join.h"
Expand All @@ -61,9 +66,17 @@ Rcpp::cppFunction(r"{
return absl::StrJoin(v, "-");
}
}", depends = "abseil")

joinString()
#> [1] "foo-bar-baz"
```

</details>
<details close>
<summary>
Usage in Rcpp package
</summary>

``` cpp
#include <Rcpp.h>
#include "absl/strings/str_join.h"
Expand All @@ -79,6 +92,8 @@ std::string joinString() {
Bare minimum R package using the `abseil` package can be found at
[doccstat/abseil-r-example](https://github.com/doccstat/abseil-r-example).

</details>

## Authors

Abseil Team, Xingchi Li
Expand Down
13 changes: 6 additions & 7 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
## Resubmission
This is a resubmission. In this version I have:
## R CMD check results

* Written package names, software names and API (application
programming interface) names in single quotes in title and description.
❯ checking installed package size ... NOTE
installed size is 13.7Mb
sub-directories of 1Mb or more:
include 13.6Mb

* More clearly identified the copyright holders in the DESCRIPTION.

* Added a .Rd file with example and info on the package.
0 errors ✔ | 0 warnings ✔ | 1 note ✖
2 changes: 1 addition & 1 deletion inst/include/absl/base/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
// LTS releases can be obtained from
// https://github.com/abseil/abseil-cpp/releases.
#define ABSL_LTS_RELEASE_VERSION 20230802
#define ABSL_LTS_RELEASE_PATCH_LEVEL 0
#define ABSL_LTS_RELEASE_PATCH_LEVEL 1

// Helper macro to convert a CPP variable to a string literal.
#define ABSL_INTERNAL_DO_TOKEN_STR(x) #x
Expand Down
20 changes: 20 additions & 0 deletions inst/include/absl/base/internal/sysinfo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@
#include <sys/sysctl.h>
#endif

#ifdef __FreeBSD__
#include <pthread_np.h>
#endif

#ifdef __NetBSD__
#include <lwp.h>
#endif

#if defined(__myriad2__)
#include <rtems.h>
#endif
Expand Down Expand Up @@ -432,6 +440,18 @@ pid_t GetTID() {
return static_cast<pid_t>(tid);
}

#elif defined(__FreeBSD__)

pid_t GetTID() { return static_cast<pid_t>(pthread_getthreadid_np()); }

#elif defined(__OpenBSD__)

pid_t GetTID() { return getthrid(); }

#elif defined(__NetBSD__)

pid_t GetTID() { return static_cast<pid_t>(_lwp_self()); }

#elif defined(__native_client__)

pid_t GetTID() {
Expand Down
2 changes: 2 additions & 0 deletions inst/include/absl/synchronization/internal/waiter.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
#define ABSL_WAITER_MODE ABSL_WAITER_MODE_SEM
#elif defined(ABSL_INTERNAL_HAVE_PTHREAD_WAITER)
#define ABSL_WAITER_MODE ABSL_WAITER_MODE_CONDVAR
#elif defined(ABSL_INTERNAL_HAVE_STDCPP_WAITER)
#define ABSL_WAITER_MODE ABSL_WAITER_MODE_STDCPP
#else
#error ABSL_WAITER_MODE is undefined
#endif
Expand Down
1 change: 1 addition & 0 deletions man/abseil-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1380a50

Please sign in to comment.