Frank Buss's fix for anon enums.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8593 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Surendra Singhi 2006-01-28 14:07:54 +00:00
commit dafc4dbdfc
2 changed files with 40 additions and 11 deletions

View file

@ -95,3 +95,17 @@
#include <string.h>
%}
%insert("lisphead") %{
;;;SWIG wrapper code starts here
(defmacro defanonenum (&body enums)
"Converts anonymous enums to defconstants."
`(progn ,@(loop for value in enums
for index = 0 then (1+ index)
when (listp value) do (setf index (second value)
value (first value))
collect `(defconstant ,value ,index))))
;;;SWIG wrapper code ends here
%}