Added platform to (features)

This commit is contained in:
Justin Ethier 2019-07-31 13:06:31 -04:00
parent 1fce5b949d
commit 0c050a3065
4 changed files with 10 additions and 1 deletions

View file

@ -9,6 +9,7 @@ Features
- Arthur Maciel added instructions for building Cyclone on FreeBSD.
- Added support for delays and promises to `(cyclone concurrent)`. Note functions/macros for both types of objects are prefixed with `shared-` to differentiate them from R7RS definitions from `(scheme lazy)`.
- Added platform (linux, bsd, etc) to the list of emitted by `(features)` and to the features recognized by `cond-expand`.
Bug Fixes

View file

@ -190,6 +190,7 @@ runtime.o : runtime.c $(HEADERS)
-DCYC_CC_EXEC=\"$(CC_EXEC)\" \
-DCYC_CC_LIB=\"$(CC_LIB)\" \
-DCYC_CC_SO=\"$(CC_SO)\" \
-DCYC_PLATFORM=\"$(PLATFORM)\" \
$< -o $@
libcyclone.a : runtime.o gc.o dispatch.o mstreams.o hashset.o

View file

@ -2647,6 +2647,11 @@ object Cyc_compilation_environment(void *data, object cont, object var)
snprintf(buf, sizeof(buf), "%s", CYC_CC_SO);
make_utf8_string(data, str, buf);
_return_closcall1(data, cont, &str);
} else if (strncmp(((symbol) var)->desc, "platform", 9) == 0) {
char buf[1024];
snprintf(buf, sizeof(buf), "%s", CYC_PLATFORM);
make_utf8_string(data, str, buf);
_return_closcall1(data, cont, &str);
}
}
Cyc_rt_raise2(data,

View file

@ -240,7 +240,9 @@
(cons
(string->symbol
(string-append "version-" *version-number*))
*other-features*)))
(cons
(string->symbol (Cyc-compilation-environment 'platform))
*other-features*))))
(define *other-features*
'(r7rs