mirror of
https://github.com/exaloop/codon.git
synced 2025-06-03 15:03:52 +08:00
Add back seq_is_macos
This commit is contained in:
parent
d763282137
commit
3e72453f82
@ -209,12 +209,12 @@ shared_ptr<ImportFile> getImportFile(const string &argv0, const string &what,
|
|||||||
auto getStdLibPaths = [](const string &argv0) {
|
auto getStdLibPaths = [](const string &argv0) {
|
||||||
vector<string> paths;
|
vector<string> paths;
|
||||||
char abs[PATH_MAX + 1];
|
char abs[PATH_MAX + 1];
|
||||||
if (auto c = getenv("SEQ_PATH")) {
|
if (auto c = getenv("CODON_PATH")) {
|
||||||
if (realpath(c, abs))
|
if (realpath(c, abs))
|
||||||
paths.push_back(abs);
|
paths.push_back(abs);
|
||||||
}
|
}
|
||||||
if (!argv0.empty())
|
if (!argv0.empty())
|
||||||
for (auto loci : {"../lib/seq/stdlib", "../stdlib", "stdlib"}) {
|
for (auto loci : {"../lib/codon/stdlib", "../stdlib", "stdlib"}) {
|
||||||
strncpy(abs, executable_path(argv0.c_str()).c_str(), PATH_MAX);
|
strncpy(abs, executable_path(argv0.c_str()).c_str(), PATH_MAX);
|
||||||
if (realpath(format("{}/{}", dirname(abs), loci).c_str(), abs))
|
if (realpath(format("{}/{}", dirname(abs), loci).c_str(), abs))
|
||||||
paths.push_back(abs);
|
paths.push_back(abs);
|
||||||
|
@ -57,6 +57,14 @@ SEQ_FUNC void seq_init(int d) {
|
|||||||
debug = d;
|
debug = d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SEQ_FUNC bool seq_is_macos() {
|
||||||
|
#ifdef __APPLE__
|
||||||
|
return true;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
SEQ_FUNC seq_int_t seq_pid() { return (seq_int_t)getpid(); }
|
SEQ_FUNC seq_int_t seq_pid() { return (seq_int_t)getpid(); }
|
||||||
|
|
||||||
SEQ_FUNC seq_int_t seq_time() {
|
SEQ_FUNC seq_int_t seq_time() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user