Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2014-11

safecall_exceptions in OSX

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

David Jenkins

I have been using the safecall functionality in linux and it has been working. I now am porting the same code to OSX and find that safecall_exceptions is not turned on. In particular I need the functionality that catches the HRESULT and passes it back to the calling function. I see that tf_safecall_exceptions is only enabled in tsysteminfo for i_linux and i_win.

Is it possible to enable tf_safecall_exceptions for i_macos.

Thanks
David Jenkins

Reply by email

Jonas Maebe
to David Jenkins
David Jenkins wrote 8 lines
I have been using the safecall functionality in linux and it has been working. I now am porting the same code to OSX and find that safecall_exceptions is not turned on. In particular I need the functionality that catches the HRESULT and passes it back to the calling function. I see that tf_safecall_exceptions is only enabled in tsysteminfo for i_linux and i_win. Is it possible to enable tf_safecall_exceptions for i_macos.

Safecall is a concept that was introduced by Microsoft under Windows, and as a result initially was only enabled there (*). Later, Mozilla sort of created a similar concept for its XPCOM framework, which is why Joost enabled, tested and fixed it also under Linux. This functionality was however never tested or verified under OS X, which is why it is not enabled there.

It can only be enabled under OS X if someone tests that the current implementation works with XPCOM there as well.

Jonas

PS: OS X-related information is not in i_macos (that's for Mac OS 9 and earlier), but in i_bsd (because Darwin at the user level is considered as a BSD variant)

(*) Well, originally it was enabled everywhere, but generated broken
code on all targets except for Windows.

Reply by email

David Jenkins
to Jonas Maebe

Thanks Jonas,

I enabled tf_safecall_exceptions for system_i386_darwin_info and it is working for my particular need.

I am using jcl (JclCompression) and the unix port of 7zip (p7zip) to provide 7z support for our app. Official current JclCompression is MSWINDOWS only and uses safecall for the interface connections to the 7z.dll. By enabling the safecall result passing for darwin I am able to use JclCompression with 7z.so with only slight modifications. So far I have seen no issues. I would not claim that this is a full test of XPCOM/safecall_exceptions on OSX.

Regards
David Jenkins

Reply by email