X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=gacela_SDL.lisp;fp=gacela_SDL.lisp;h=6ff5c1b02278dbe9d5860fc920329b0af771f0d3;hb=8caa865a3194eb573382a411df7636ebb472ca1f;hp=af72bf1712de85475736ad3b046331c3f3fef505;hpb=35c768d6dbc22d731b9f2626b783b91530ea651f;p=gacela.git diff --git a/gacela_SDL.lisp b/gacela_SDL.lisp index af72bf1..6ff5c1b 100644 --- a/gacela_SDL.lisp +++ b/gacela_SDL.lisp @@ -17,6 +17,16 @@ (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 ") (clines "#include ") (clines "#include ")