Skip to content

Commit

Permalink
Fix bool foreign type
Browse files Browse the repository at this point in the history
used cffi-grovel, because sizeof(bool) is implementation-dependent
and may differ from sizeof(int).
  • Loading branch information
glider-gun committed May 26, 2015
1 parent 9bb94ef commit 853e815
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cl-charms.asd
Expand Up @@ -38,11 +38,13 @@
:license "MIT License (See COPYING)"
:depends-on (#:cffi
#:alexandria)
:defsystem-depends-on (#:cffi-grovel) ; for processing :cffi-grovel-file
:serial t
:pathname "src/"
:components ((:module "low-level"
:serial t
:components ((:file "package")
(:cffi-grovel-file "curses-grovel")
(:file "curses-bindings")))
(:module "high-level"
:serial t
Expand Down
2 changes: 1 addition & 1 deletion src/low-level/curses-bindings.lisp
Expand Up @@ -89,7 +89,7 @@


;; types
(cffi:defctype bool :int)
;; note: bool definition is moved into grovel file (curses-grovel.lisp)
(cffi:defctype char-ptr :pointer)
(cffi:defctype chtype :int)
(cffi:defctype file-ptr :pointer)
Expand Down
5 changes: 5 additions & 0 deletions src/low-level/curses-grovel.lisp
@@ -0,0 +1,5 @@
;; (include "/usr/include/ncurses.h")
(include "ncurses.h")
(in-package #:cl-charms/low-level)

(ctype bool "bool") ;; grovel it, because sizeof(bool) is implementation-dependent

0 comments on commit 853e815

Please sign in to comment.