Skip to content

Commit

Permalink
CS_INT*->number is fully hygienic, therefore we can use syntax-rules
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Bex committed May 10, 2011
1 parent 9d60f80 commit d9bc542
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions freetds.scm
Expand Up @@ -197,13 +197,10 @@ with the FreeTDS egg. If not, see <http://www.gnu.org/licenses/>.
((exn) (sql-null)))))

(define-syntax CS_INT*->number
(er-macro-transformer
(lambda (expression rename compare)
(match-let (((_ int* type return-type) expression))
(let ((%foreign-safe-lambda*
(rename 'foreign-safe-lambda*)))
`((,%foreign-safe-lambda* ,return-type (((c-pointer ,type) i))
"C_return((int) *i);") ,int*))))))
(syntax-rules ()
((_ int* type return-type)
((foreign-safe-lambda* return-type (((c-pointer type) i))
"C_return((int) *i);") int*))))

(define (CS_BINARY*->vector binary* length)
(let ((vector (make-u8vector length 0)))
Expand Down

0 comments on commit d9bc542

Please sign in to comment.