aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--auto.def4
-rw-r--r--jim-file.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/auto.def b/auto.def
index f88976b..8a21550 100644
--- a/auto.def
+++ b/auto.def
@@ -191,6 +191,10 @@ if {"-Werror" in [get-define CFLAGS] && [cctest -cflags -Wno-error]} {
cc-with {-cflags -Wno-error}
}
+# Very old compilers might not have restrict
+cc-check-some-feature restrict {
+ cctest -declare {extern void restrict_test(const char * restrict param);}
+}
cc-check-types "long long"
cc-check-sizeof int
diff --git a/jim-file.c b/jim-file.c
index c18fbd0..7002832 100644
--- a/jim-file.c
+++ b/jim-file.c
@@ -370,6 +370,10 @@ static int file_cmd_tail(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
return JIM_OK;
}
+#ifndef HAVE_RESTRICT
+#define restrict
+#endif
+
static char *JimRealPath(const char *restrict path, char *restrict resolved_path, size_t len)
{
#if ISWINDOWS