开发者

Genie syntax for extern declarations

开发者 https://www.devze.com 2023-03-30 09:36 出处:网络
Can anyone point me towards the syntax for extern declarations in Genie. Extern decls are supported in Vala, therefore they should also be available in Genie but I cannot seem to hit on the correct sy

Can anyone point me towards the syntax for extern declarations in Genie. Extern decls are supported in Vala, therefore they should also be available in Genie but I cannot seem to hit on the correct syntax. I'm trying to expose the C "exit" function so I can quit the application after an exception has occured.

Vala syntax for extern:

ext开发者_如何转开发ern void exit(int exit_code);

Genie syntax for extern?

extern def exit(exit_code:int):void

Obviously this syntax is incorrect or I wouldn't be asking this question :) but I think this is approximately the form it should take, can anyone assist?

Thanks - G


Derp!, I figured it out eventually, the problem was with my use of the indent declaration to specify the 4 space indentation style I favour. This must be the first declaration in the code, but I had foolishly placed the extern declaration before the indent declaration.

The correct syntax is as follows:

[indent=4]
def extern exit(code:int):void
0

精彩评论

暂无评论...
验证码 换一张
取 消