Update to the new Smoke ABI (v.3)
Sun Dec 13 11:17:08 CET 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Update to the new Smoke ABI (v.3)
diff -rN -u old-smoke/src/objects/method.lisp new-smoke/src/objects/method.lisp
--- old-smoke/src/objects/method.lisp 2014-10-30 07:05:42.000000000 +0100
+++ new-smoke/src/objects/method.lisp 2014-10-30 07:05:42.000000000 +0100
@@ -181,6 +181,14 @@
"Returns T when METHOD is protected; NIL otherwise."
(/= 0 (get-method-flag method :protected)))
+(defun attribute-p (method)
+ "Returns T when METHOD accesses C++ member/static variables."
+ (/= 0 (get-method-flag method :attribute)))
+
+(defun property-p (method)
+ "Returns T when METHOD accesses a Q_PROPERTY."
+ (/= 0 (get-method-flag method :property)))
+
(defmethod const-p ((method smoke-method))
"Returns T when METHOD is a const method and NIL otherwise."
(/= 0 (get-method-flag method :const)))
diff -rN -u old-smoke/src/smoke-c/class.lisp new-smoke/src/smoke-c/class.lisp
--- old-smoke/src/smoke-c/class.lisp 2014-10-30 07:05:42.000000000 +0100
+++ new-smoke/src/smoke-c/class.lisp 2014-10-30 07:05:42.000000000 +0100
@@ -14,7 +14,8 @@
(parents smoke-index)
(class-function :pointer)
(enum-function :pointer)
- (flags :unsigned-short))
+ (flags :unsigned-short)
+ (size :unsigned-int))
(defcfun smoke-find-class :void
(m :pointer smoke-module-index)
diff -rN -u old-smoke/src/smoke-c/method.lisp new-smoke/src/smoke-c/method.lisp
--- old-smoke/src/smoke-c/method.lisp 2014-10-30 07:05:42.000000000 +0100
+++ new-smoke/src/smoke-c/method.lisp 2014-10-30 07:05:42.000000000 +0100
@@ -9,7 +9,13 @@
(:enum #x10)
(:constructor #x20)
(:destructor #x40)
- (:protected #x80))
+ (:protected #x80)
+ (:attribute #x100)
+ (:property #x200)
+ (:virtual #x400)
+ (:purevirtual #x800)
+ (:signal #x1000)
+ (:slot #x2000))
(defcstruct smoke-method
"Describe a method"
@@ -17,7 +23,7 @@
(name smoke-index)
(arguments smoke-index)
(num-args :unsigned-char)
- (flags :unsigned-char)
+ (flags :unsigned-short)
(return-type smoke-index)
(method smoke-index))
diff -rN -u old-smoke/src/smoke-c/smoke-c.lisp new-smoke/src/smoke-c/smoke-c.lisp
--- old-smoke/src/smoke-c/smoke-c.lisp 2014-10-30 07:05:42.000000000 +0100
+++ new-smoke/src/smoke-c/smoke-c.lisp 2014-10-30 07:05:42.000000000 +0100
@@ -3,7 +3,7 @@
;; Load the qt smoke binding to prevent undefined aliens.
(eval-when (:load-toplevel :compile-toplevel :execute)
(define-foreign-library libsmokeqt
- (:unix "libsmokeqt.so.2")
+ (:unix "libsmokeqt.so.3")
(t (:default "libsmokeqt")))
#-mudballs
(define-foreign-library libsmoke-c
@@ -51,6 +51,8 @@
(defcfun smoke-destruct :void
(smoke smoke-binding))
+;; Smoke::ModuleIndex is a POD-struct.
+;; Thus we can treat it as a C struct.
(defcstruct smoke-module-index
(smoke :pointer)
(index smoke-index))
diff -rN -u old-smoke/src/smoke.lisp new-smoke/src/smoke.lisp
--- old-smoke/src/smoke.lisp 2014-10-30 07:05:42.000000000 +0100
+++ new-smoke/src/smoke.lisp 2014-10-30 07:05:42.000000000 +0100
@@ -178,7 +178,7 @@
`(progn
(eval-when (:compile-toplevel :load-toplevel :execute)
(define-foreign-library ,library
- (:unix ,(format nil "~(~A~).so.2.0" library))
+ (:unix ,(format nil "~(~A~).so.3" library))
(t (:default ,(format nil "~(~A~)" library)))))
(eval-startup (:compile-toplevel :execute)
(load-foreign-library ',library))
@@ -186,10 +186,7 @@
(eval-startup (:compile-toplevel :execute)
(defcvar (,variable ,variable-name :read-only t :library ,library)
:pointer)
- (defcfun (,init-function ,(format nil "_Z~A~Av"
- (length function-name)
- function-name)
- :library ,library)
+ (defcfun (,init-function ,function-name :library ,library)
:void))
(eval-when (:compile-toplevel :load-toplevel :execute)
(defparameter ,smoke-module (make-smoke-module)))
diff -rN -u old-smoke/test-bundle.sh new-smoke/test-bundle.sh
--- old-smoke/test-bundle.sh 2014-10-30 07:05:42.000000000 +0100
+++ new-smoke/test-bundle.sh 2014-10-30 07:05:42.000000000 +0100
@@ -5,8 +5,8 @@
exit 1
fi
-sbcl --eval '(mb:load :qt.tests)' \
+MALLOC_CHECK_=3 sbcl --eval '(mb:load :qt.tests)' \
--eval '(smoke:save-bundle "qt.test.run")' \
--eval '(quit)' || exit 1
-echo "(progn (5am:run!) (quit))" | ./qt.test.run
+echo "(progn (in-package :qt.tests) (5am:run!) (quit))" | MALLOC_CHECK_=3 ./qt.test.run