Re: Correct way to throw exceptions/errors from C to ST

Roland Plüss <[email protected]>
Newsgroups gmane.comp.lang.smalltalk.gnu.general
Message-ID <[email protected]>
On 04/12/2015 07:42 PM, Holger Freyther wrote:
>> On 12 Apr 2015, at 16:19, Roland Plüss <[email protected]> wrote:
>>
>> Maybe the question got lost in the mailing list? What does make a
>> primitive fail as seen from the Smalltalk VM?
> If you have a look at libgst/prims.def there is PRIMS_FAILED to indicate
> that a primitive failed. Is VMpr_CFuncDescriptor_call the call you end up
> making? In that case if NULL is returned from the c binding layer the
> primitive will fail
That sounds good but I don't know if I use that. My setup looks
something like this:

    gst_define_cfunc( "DECanvas.getCanvasCount", ( void*
)ccGetCanvasCount );

and in this example ccGetCanvasCount is:

int stClassCanvas::ccGetCanvasCount( OOP self ){
   return some integer;
}

So I don't think I'm using that function. Or does it automatically do
this if the return value is OOP?

-- 
Mit freundlichen Grüssen
Plüss Roland

Leader und Head Programmer
- Game: Epsylon ( http://www.indiedb.com/games/epsylon )
- Game Engine: Drag[en]gine ( http://www.indiedb.com/engines/dragengine
, http://dragengine.rptd.ch/wiki )
- Normal Map Generator: DENormGen ( http://epsylon.rptd.ch/denormgen.php )
- Sowie verschiedene Blender Export-Skripts und Game-Tools

_______________________________________________
help-smalltalk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
signature.asc (application/pgp-signature, 181 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iEYEARECAAYFAlUqxRIACgkQjKGu9ysRWfo9ggCfVSCbfyFIpEH56UCOsktYF9/y
gMMAnRJvWRJeF/F13VGX8fkuRJGonqo+
=tdDv
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.