summaryrefslogtreecommitdiffstats
path: root/txr.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-09-10 20:23:27 -0700
committerKaz Kylheku <kaz@kylheku.com>2014-09-10 20:23:27 -0700
commit75c9240632d0f69d25390814b835523a23ebfb19 (patch)
tree07a7ad0289ae2632b94e199e56c46bc3358e27e1 /txr.c
parent063b5a8c138e68237e11bcdac2f5763243b9bfc7 (diff)
downloadtxr-75c9240632d0f69d25390814b835523a23ebfb19.tar.gz
txr-75c9240632d0f69d25390814b835523a23ebfb19.tar.bz2
txr-75c9240632d0f69d25390814b835523a23ebfb19.zip
* lib.c (compat_fixup): void return changed to int.
Returns minimum supported emulation. * lib.h (compat_fixup): Declaration fixed. * txr.c (compat): Replace hard-coded min version by return value of compat_fixup.
Diffstat (limited to 'txr.c')
-rw-r--r--txr.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/txr.c b/txr.c
index 65880002..b9c11e5f 100644
--- a/txr.c
+++ b/txr.c
@@ -328,13 +328,17 @@ static int do_fixnum_opt(int (*opt_func)(val), val opt, val arg)
static int compat(val optval)
{
- if ((opt_compat = c_num(optval)) < 97) {
+ int compat = c_num(optval);
+ int min = compat_fixup(compat);
+
+ if (min) {
format(std_error, lit("~a: compatibility with versions "
- "lower than 97 not supported by version ~a\n"),
- prog_string, auto_str(version), nao);
+ "lower than ~a not supported by version ~a\n"),
+ prog_string, num(min), auto_str(version), nao);
return 0;
}
- compat_fixup(opt_compat);
+
+ opt_compat = compat;
return 1;
}