1
0
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:
A. R. Shajii 2021-09-30 15:45:45 -04:00
parent d763282137
commit 3e72453f82
3 changed files with 13 additions and 5 deletions

View File

@ -209,12 +209,12 @@ shared_ptr<ImportFile> getImportFile(const string &argv0, const string &what,
auto getStdLibPaths = [](const string &argv0) {
vector<string> paths;
char abs[PATH_MAX + 1];
if (auto c = getenv("SEQ_PATH")) {
if (auto c = getenv("CODON_PATH")) {
if (realpath(c, abs))
paths.push_back(abs);
}
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);
if (realpath(format("{}/{}", dirname(abs), loci).c_str(), abs))
paths.push_back(abs);

View File

@ -57,6 +57,14 @@ SEQ_FUNC void seq_init(int 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_time() {