Skip to content

Commit fc56b46

Browse files
committed
rename systemFile() to archSystemFile()
The previous name did not convey how the helper differs from system.file(); the distinguishing behavior is injection of the architecture-specific subdirectory.
1 parent 3cc8e66 commit fc56b46

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

R/tbb.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ tbbLibraryPath <- function(name = NULL) {
4242
if (file.exists(tbbName))
4343
return(tbbName)
4444

45-
tbbName <- systemFile("lib", libName)
45+
tbbName <- archSystemFile("lib", libName)
4646
if (file.exists(tbbName))
4747
return(tbbName)
4848

@@ -88,7 +88,7 @@ tbbLdFlags <- function() {
8888
# on Windows, we statically link to oneTBB
8989
if (is_windows()) {
9090

91-
libPath <- systemFile("libs")
91+
libPath <- archSystemFile("libs")
9292

9393
ldFlags <- sprintf("-L%s -lRcppParallel", asBuildPath(libPath))
9494
return(ldFlags)
@@ -123,6 +123,6 @@ tbbRoot <- function() {
123123
if (nzchar(TBB_LIB))
124124
return(TBB_LIB)
125125

126-
systemFile("lib")
126+
archSystemFile("lib")
127127

128128
}

R/utils.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# like system.file(), but injects the architecture-specific subdirectory
3-
# used on Windows when set; e.g. systemFile("lib") resolves 'lib/x64'
4-
systemFile <- function(dir, name = NULL) {
3+
# used on Windows when set; e.g. archSystemFile("lib") resolves 'lib/x64'
4+
archSystemFile <- function(dir, name = NULL) {
55
arch <- .Platform$r_arch
66
parts <- c(dir, if (nzchar(arch)) arch, name)
77
system.file(paste(parts, collapse = "/"), package = "RcppParallel")

R/zzz.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ loadTbbLibrary <- function(name) {
2323
# NOTE: resolve against the package's own library directory, where
2424
# install.libs.R places the stub; tbbRoot() would prefer TBB_LIB,
2525
# which on Windows points at Rtools and holds only static libraries
26-
path <- systemFile("lib", paste0(name, ".dll"))
26+
path <- archSystemFile("lib", paste0(name, ".dll"))
2727
if (!file.exists(path))
2828
return(NULL)
2929

0 commit comments

Comments
 (0)