try and remove warnings on windows, format os.c.
@@ -673,7 +673,13 @@ static Janet os_date(int32_t argc, Janet *argv) {
return janet_wrap_struct(janet_struct_end(st));
}
-static int64_t entry_getint(Janet env_entry, char *field) {
+#ifdef JANET_WINDOWS
+typedef int32_t timeint_t;
+#else
+typedef int64_t timeint_t;
+#endif
+
+static timeint_t entry_getint(Janet env_entry, char *field) {
Janet i;
if (janet_checktype(env_entry, JANET_TABLE)) {
JanetTable *entry = janet_unwrap_table(env_entry);
@@ -689,12 +695,19 @@ static int64_t entry_getint(Janet env_entry, char *field) {
return 0;
}
+#ifdef JANET_WINDOWS
+ if (!janet_checkint(i)) {
+ janet_panicf("bad slot #%s, expected 32 bit signed integer, got %v",
+ field, i);
+ }
+#else
if (!janet_checkint64(i)) {
- janet_panicf("bad slot :%s, expected 64 bit signed integer, got %v",
+ janet_panicf("bad slot #%s, expected 64 bit signed integer, got %v",
field, i);
}
+#endif
- return (int64_t)janet_unwrap_number(i);
+ return (timeint_t)janet_unwrap_number(i);
}
static Janet os_mktime(int32_t argc, Janet *argv) {
