From: Wolfgang T. <wth...@us...> - 2006-03-17 04:54:48
|
Update of /cvsroot/hoc/hoc/HOC/HOC In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11386/HOC/HOC Modified Files: FFICallInterface.hs MsgSend.hs Log Message: Deal with structure returns in a way that works for x86, too. Index: FFICallInterface.hs =================================================================== RCS file: /cvsroot/hoc/hoc/HOC/HOC/FFICallInterface.hs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- FFICallInterface.hs 27 Feb 2004 12:21:34 -0000 1.2 +++ FFICallInterface.hs 17 Mar 2006 04:54:45 -0000 1.3 @@ -52,6 +52,8 @@ members <- newArray0 (FFIType nullPtr) members allocStructType members +foreign import ccall unsafe cifIsStret :: FFICif -> IO CInt + -- typeable instances instance FFITypeable () where Index: MsgSend.hs =================================================================== RCS file: /cvsroot/hoc/hoc/HOC/HOC/MsgSend.hs,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- MsgSend.hs 3 Aug 2005 00:32:37 -0000 1.8 +++ MsgSend.hs 17 Mar 2006 04:54:45 -0000 1.9 @@ -83,7 +83,8 @@ objSendMessageWithRetval cif args = withMarshalledDummy $ \dummy -> - callWithRetval cif (if isStructType dummy + cifIsStret cif >>= \isStret -> + callWithRetval cif (if isStret /= 0 then objc_msgSend_stretPtr else objc_msgSendPtr) args @@ -93,7 +94,8 @@ superSendMessageWithRetval cif args = withMarshalledDummy $ \dummy -> - callWithRetval cif (if isStructType dummy + cifIsStret cif >>= \isStret -> + callWithRetval cif (if isStret /= 0 then objc_msgSendSuper_stretPtr else objc_msgSendSuperPtr) args |