1
0
mirror of https://github.com/janet-lang/janet synced 2025-01-16 10:25:40 +00:00

Merge branch 'master' into ev

This commit is contained in:
Calvin Rose 2020-07-03 12:26:01 -05:00
commit f264cb0b18
2 changed files with 4 additions and 1 deletions

View File

@ -1400,7 +1400,7 @@ static Janet cfun_peg_replace_generic(int32_t argc, Janet *argv, int only_one) {
janet_buffer_push_bytes(ret, c.bytes.bytes + trail, (i - trail)); janet_buffer_push_bytes(ret, c.bytes.bytes + trail, (i - trail));
trail = i; trail = i;
} }
int32_t nexti = result - c.bytes.bytes; int32_t nexti = (int32_t)(result - c.bytes.bytes);
janet_buffer_push_bytes(ret, c.repl.bytes, c.repl.len); janet_buffer_push_bytes(ret, c.repl.bytes, c.repl.len);
trail = nexti; trail = nexti;
if (nexti == i) nexti++; if (nexti == i) nexti++;

View File

@ -100,6 +100,9 @@ void janet_core_cfuns(JanetTable *env, const char *regprefix, const JanetReg *cf
/* Clock gettime */ /* Clock gettime */
#if !defined(JANET_REDUCED_OS) || !defined(JANET_SINGLE_THREADED) #if !defined(JANET_REDUCED_OS) || !defined(JANET_SINGLE_THREADED)
#include <time.h> #include <time.h>
#ifndef JANET_WINDOWS
#include <sys/time.h>
#endif
#define JANET_GETTIME #define JANET_GETTIME
int janet_gettime(struct timespec *spec); int janet_gettime(struct timespec *spec);
#endif #endif