diff --git a/Lib/cffi/cffi.swg b/Lib/cffi/cffi.swg index 102430a23..c6fb29cf7 100644 --- a/Lib/cffi/cffi.swg +++ b/Lib/cffi/cffi.swg @@ -95,3 +95,17 @@ #include %} + +%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 +%} diff --git a/Source/Modules/cffi.cxx b/Source/Modules/cffi.cxx index 9ef36564e..8b736f914 100644 --- a/Source/Modules/cffi.cxx +++ b/Source/Modules/cffi.cxx @@ -20,7 +20,7 @@ public: File *f_cl; String *f_clhead; String *f_clwrap; - + bool CWrap; // generate wrapper file for C code? File *f_cxx; File *f_cxx_header; File *f_cxx_wrapper; @@ -59,7 +59,7 @@ void CFFI :: main(int argc, char *argv[]) { SWIG_config_file("cffi.swg"); generate_typedef_flag = 0; extern_all_flag=0; - + CWrap = false; for(i=1; i