diff --git a/support.scm b/support.scm
index d2fde7a..77e3fa9 100644
a
|
b
|
|
1119 | 1119 | ;;; Convert result value, if a string: |
1120 | 1120 | |
1121 | 1121 | (define (finish-foreign-result type body) |
1122 | | (case type |
| 1122 | (case (##sys#strip-syntax type) |
1123 | 1123 | [(c-string unsigned-c-string) `(##sys#peek-c-string ,body '0)] |
1124 | 1124 | [(nonnull-c-string) `(##sys#peek-nonnull-c-string ,body '0)] |
1125 | 1125 | [(c-string* unsigned-c-string*) `(##sys#peek-and-free-c-string ,body '0)] |
… |
… |
|
1129 | 1129 | [(c-string-list*) `(##sys#peek-and-free-c-string-list ,body '#f)] |
1130 | 1130 | [else |
1131 | 1131 | (if (list? type) |
1132 | | (if (and (eq? (car type) 'const) |
| 1132 | (if (and (eq? (##sys#strip-syntax (car type)) 'const) |
1133 | 1133 | (= 2 (length type)) |
1134 | | (memq (cadr type) '(c-string c-string* unsigned-c-string |
1135 | | unsigned-c-string* nonnull-c-string |
1136 | | nonnull-c-string* |
1137 | | nonnull-unsigned-string*))) |
| 1134 | (memq (##sys#strip-syntax (cadr type)) |
| 1135 | '(c-string c-string* unsigned-c-string |
| 1136 | unsigned-c-string* nonnull-c-string |
| 1137 | nonnull-c-string* |
| 1138 | nonnull-unsigned-string*))) |
1138 | 1139 | (finish-foreign-result (cadr type) body) |
1139 | 1140 | (if (= 3 (length type)) |
1140 | 1141 | (case (car type) |
diff --git a/tests/compiler-tests.scm b/tests/compiler-tests.scm
index 43e308e..f4feb01 100644
a
|
b
|
|
125 | 125 | (fp))) |
126 | 126 | |
127 | 127 | |
| 128 | ;; "const" qualifier should have no visible effect in Scheme |
| 129 | (define-syntax generate-external |
| 130 | (syntax-rules () |
| 131 | ((_) (define-external |
| 132 | (print_foo ((const c-string) foo)) |
| 133 | void |
| 134 | (assert (string? foo)) |
| 135 | (print foo))))) |
| 136 | (generate-external) |
| 137 | ((foreign-safe-lambda* void () |
| 138 | "print_foo(\"bar\");")) |
| 139 | |
| 140 | |
128 | 141 | ;;; compiler-syntax for map/for-each must be careful when the |
129 | 142 | ; operator may have side-effects (currently only lambda exprs and symbols |
130 | 143 | ; are allowed) |