diff --git a/CHANGELOG.md b/CHANGELOG.md index 05536a9fd..2b71537af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/Makefile b/Makefile index 4bc28bb7d..caf491841 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/runtime.c b/runtime.c index 039403354..bbbc6503d 100644 --- a/runtime.c +++ b/runtime.c @@ -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, diff --git a/scheme/base.sld b/scheme/base.sld index cccb802f8..ff232d55c 100644 --- a/scheme/base.sld +++ b/scheme/base.sld @@ -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