[allegrocl] Small set of bug fixes and typemap tweaks.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12748 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
d38e6bdf43
commit
b8dcf31539
4 changed files with 125 additions and 26 deletions
|
|
@ -16,6 +16,7 @@
|
|||
float, double, long double, char *, void *,
|
||||
enum SWIGTYPE "(cl::setq ACL_ffresult $body)";
|
||||
%typemap(lout) void "$body";
|
||||
#ifdef __cplusplus
|
||||
%typemap(lout) SWIGTYPE[ANY], SWIGTYPE *,
|
||||
SWIGTYPE &
|
||||
%{ (cl:let* ((address $body)
|
||||
|
|
@ -25,6 +26,12 @@
|
|||
(cl:setq ACL_ffresult new-inst)) %}
|
||||
|
||||
%typemap(lout) SWIGTYPE "(cl::let* ((address $body)\n (new-inst (cl::make-instance '$lclass :foreign-address address)))\n (cl::unless (cl::zerop address)\n (excl:schedule-finalization new-inst #'$ldestructor))\n (cl::setq ACL_ffresult new-inst))";
|
||||
#else
|
||||
%typemap(lout) SWIGTYPE[ANY], SWIGTYPE *, SWIGTYPE &, SWIGTYPE
|
||||
%{ (cl:let* ((address $body)
|
||||
(new-inst (cl:make-instance '$lclass :foreign-address address)))
|
||||
(cl:setq ACL_ffresult new-inst)) %}
|
||||
#endif
|
||||
|
||||
%typemap(lisptype) bool, const bool "cl:boolean";
|
||||
%typemap(lisptype) char, const char "cl:character";
|
||||
|
|
|
|||
|
|
@ -7,27 +7,43 @@
|
|||
* functions have been defined.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
%typemap(in) long long, unsigned long long "$1 = $input;";
|
||||
%typemap(out) long long, unsigned long long "$result = &$1;";
|
||||
#ifdef Acl64Bit
|
||||
%typemap(ctype) long long, unsigned long long "$1_ltype";
|
||||
%typemap(out) long long, unsigned long long "$result = $1;";
|
||||
|
||||
%typemap(ffitype) long long ":nat";
|
||||
%typemap(ffitype) unsigned long long ":unsigned-nat";
|
||||
|
||||
%typemap(lout) long long, unsigned long long " #+64bit (cl::setq ACL_ffresult $body)";
|
||||
|
||||
#else
|
||||
%typemap(out) long long, unsigned long long "$result = &$1;";
|
||||
%typemap(ffitype) long long "(:struct (l1 :long) (l2 :long))";
|
||||
%typemap(ffitype) unsigned long long "(:struct (l1 :unsigned-long)
|
||||
(l2 :unsigned-long))";
|
||||
|
||||
%typemap(ffitype) unsigned long long "(:struct (l1 :unsigned-long) (l2 :unsigned-long))";
|
||||
|
||||
%typemap(lout) long long
|
||||
" (make-instance #.(swig-insert-id \"longlong\" () :type :class)
|
||||
:foreign-address $body)";
|
||||
" (cl::setq ACL_ffresult (make-instance '#.(swig-insert-id \"longlong\" () :type :class)
|
||||
:foreign-address $body))";
|
||||
|
||||
%typemap(lout) unsigned long long
|
||||
" (make-instance #.(swig-insert-id \"ulonglong\" () :type :class)
|
||||
:foreign-address $body)";
|
||||
" (cl:setq ACL_ffresult (make-instance '#.(swig-insert-id \"ulonglong\" () :type :class)
|
||||
:foreign-address $body))";
|
||||
|
||||
#endif
|
||||
|
||||
%typemap(in) long long, unsigned long long "$1 = $input;";
|
||||
|
||||
|
||||
%insert("lisphead") %{
|
||||
|
||||
#-64bit
|
||||
(swig-def-foreign-class "longlong"
|
||||
(ff:foreign-pointer)
|
||||
(:struct (:struct (l1 :long) (l2 :long))))
|
||||
(:struct (l1 :long) (l2 :long)))
|
||||
|
||||
#-64bit
|
||||
(swig-def-foreign-class "ulonglong"
|
||||
(ff:foreign-pointer)
|
||||
(:struct (:struct (l1 :unsigned-long) (l2 :unsigned-long))))
|
||||
(:struct (l1 :unsigned-long) (l2 :unsigned-long)))
|
||||
%}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue