]> git.jsancho.org Git - gacela.git/blobdiff - gacela_FTGL.lisp
(no commit message)
[gacela.git] / gacela_FTGL.lisp
index d1b0d19978c26ea2427ac2502de44a1da3b99bc5..8fa2bd02fa625e9491fdf04b5ed1e5da2299a0f4 100644 (file)
 
 (in-package :gacela)
 
+(defmacro mapcconst (type c-type name)
+  (let ((c-header (concatenate 'string c-type " gacela_" name " (void)"))
+       (c-body (concatenate 'string "return " name ";"))
+       (c-name (concatenate 'string "gacela_" name))
+       (lisp-name (intern (string-upcase name))))
+    `(progn
+       (defcfun ,c-header 0 ,c-body)
+       (defentry ,lisp-name () (,type ,c-name))
+       (eval-when (load) (defconstant ,lisp-name (,lisp-name))))))
+
 (clines "#include <FTGL/ftgl.h>")
 
 (mapcconst int "int" "ft_encoding_unicode")