1
0
mirror of https://github.com/janet-lang/janet synced 2025-01-24 14:16:52 +00:00
Re-add ifdef for realpath config option.
This commit is contained in:
Calvin Rose 2020-06-14 15:49:39 -05:00
parent b7cd13bb0b
commit 106437bd45

View File

@ -1225,6 +1225,9 @@ static Janet os_rename(int32_t argc, Janet *argv) {
static Janet os_realpath(int32_t argc, Janet *argv) { static Janet os_realpath(int32_t argc, Janet *argv) {
janet_fixarity(argc, 1); janet_fixarity(argc, 1);
const char *src = janet_getcstring(argv, 0); const char *src = janet_getcstring(argv, 0);
#ifdef JANET_NO_REALPATH
janet_panic("os/realpath not enabled for this platform");
#else
#ifdef JANET_WINDOWS #ifdef JANET_WINDOWS
char *dest = _fullpath(NULL, src, _MAX_PATH); char *dest = _fullpath(NULL, src, _MAX_PATH);
#else #else
@ -1234,6 +1237,7 @@ static Janet os_realpath(int32_t argc, Janet *argv) {
Janet ret = janet_cstringv(dest); Janet ret = janet_cstringv(dest);
free(dest); free(dest);
return ret; return ret;
#endif
} }
static Janet os_permission_string(int32_t argc, Janet *argv) { static Janet os_permission_string(int32_t argc, Janet *argv) {