summaryrefslogtreecommitdiff
path: root/cmamut.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'cmamut.lisp')
-rw-r--r--cmamut.lisp15
1 files changed, 6 insertions, 9 deletions
diff --git a/cmamut.lisp b/cmamut.lisp
index 8eac12f..fddf790 100644
--- a/cmamut.lisp
+++ b/cmamut.lisp
@@ -1,8 +1,6 @@
(in-package #:cmamut)
; TODO: Use c2ffi to extract the spec.json using the header file as parameter
-; TODO: Enums are only seen by C++ constructs, C only sees numbers.
-; When extracting C headers, enums should be converted into hash defines so that functions can use them easily.
(defparameter +target-package+ (gensym))
@@ -88,13 +86,12 @@
(cooked-fields (queue:new)))
(dotimes (j (length raw-fields))
(queue:add cooked-fields
- (list (intern (gethash "name" (aref raw-fields j)) +target-package+)
- (gethash "value" (aref raw-fields j)))))
- `(sb-alien:define-alien-type
- nil
- (sb-alien:enum
- ,name
- ,@(queue:to-list cooked-fields)))))
+ `(defparameter
+ ,(intern (gethash "name" (aref raw-fields j)) +target-package+)
+ ,(gethash "value" (aref raw-fields j)))))
+ `(progn
+ ,name
+ ,@(queue:to-list cooked-fields))))
(defun generate-enum-references (raw-typedefs)
(let ((enum-references (make-hash-table :test #'equal :size 256)))