From 4a940918ee9f2555dc0492419fff24205b94b6bb Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Sun, 3 Jan 2016 21:34:16 -0500 Subject: [PATCH] Fix compilation of make-mutex Issue was that this takes no application-level arguments but does take a 'data' argument. So this required some modifications since we never had a function with those specific needs before. --- scheme/cyclone/cgen.sld | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scheme/cyclone/cgen.sld b/scheme/cyclone/cgen.sld index 9020f8a1..e99d5644 100644 --- a/scheme/cyclone/cgen.sld +++ b/scheme/cyclone/cgen.sld @@ -671,7 +671,7 @@ ((eq? p 'make-vector) "object") ((eq? p 'list->string) "object") ((eq? p 'list->vector) "object") - ((eq? p 'make-mutex) "object") + ;((eq? p 'make-mutex) "object") ((eq? p 'mutex-lock!) "object") ((eq? p 'mutex-unlock!) "object") ((eq? p 'Cyc-installation-dir) "object") @@ -696,7 +696,8 @@ string-length substring + - * / apply command-line-arguments - make-mutex mutex-lock! mutex-unlock! + ;make-mutex + mutex-lock! mutex-unlock! Cyc-minor-gc Cyc-read-line read-char peek-char @@ -710,7 +711,7 @@ symbol->string list->string substring string-append make-vector list->vector Cyc-installation-dir)))) -;; Primitive functions that pass a continuation but have no other arguments +;; Primitive functions that pass a continuation or thread data but have no other arguments (define (prim:cont/no-args? exp) (and (prim? exp) (member exp '(command-line-arguments make-mutex Cyc-minor-gc)))) @@ -897,7 +898,8 @@ (c:append (let () ;; Add a comma if necessary - (if (str-ending? (c:body c-fun) "(") + (if (or (str-ending? (c:body c-fun) "(") + (prim:cont/no-args? fun)) c-fun (c:append c-fun (c-code ", ")))) c-args*)