CEF1/CEF3 using stdcall for CEF_CALLBACK on windows?

Think CEF could benefit from a new feature or capability? Discuss CEF feature requests here.

CEF1/CEF3 using stdcall for CEF_CALLBACK on windows?

Postby fddima » Tue May 15, 2012 8:31 am

Hi.

It is have any reason to use different calling conventions for CEF_CALLBACK on windows and other platforms?
Now we have cdecl for exported methods, and stdcall on virtual calls in C API on windows platform.
On other platforms - it is becomes both using cdecl.
May be have sense use one calling convention on any platform (cdecl i think is better choice)?

PS: Just for me, for CefGlue (.NET) i must specify calling conv for delegates, and there is compile time constant.
If CEF will use same callconv for any platforms - then CefGlue will can be run on other platforms without recompiling.

EDIT: I'm little lied before - i can use Winapi callconv which on windows is stdcall, and on unix is probably cdecl - but it is just hidden defaults.
fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am

Re: CEF1/CEF3 using stdcall for CEF_CALLBACK on windows?

Postby magreenblatt » Wed May 16, 2012 12:34 pm

The change sounds OK to me (or, at least, we can make it a build option). Please add an issue to the CEF issue tracker.
magreenblatt
Site Admin
 
Posts: 12383
Joined: Fri May 29, 2009 6:57 pm

Re: CEF1/CEF3 using stdcall for CEF_CALLBACK on windows?

Postby magreenblatt » Wed May 16, 2012 12:43 pm

Is the structure padding the same for GCC and MSVC? You should probably test to make sure a cdecl binary is as cross-platform as you're hoping.
magreenblatt
Site Admin
 
Posts: 12383
Joined: Fri May 29, 2009 6:57 pm

Re: CEF1/CEF3 using stdcall for CEF_CALLBACK on windows?

Postby fddima » Wed May 16, 2012 12:52 pm

magreenblatt wrote:Is the structure padding the same for GCC and MSVC? You should probably test to make sure a cdecl binary is as cross-platform as you're hoping.

If you mean struct packing / alignment (#pragma pack) - then it is looks same by defaults. And while we have only pointer-sized fields on structs - any pack value doesn't have any real effect. With struct like cef_browser_settings_t i'm also doesn't have problems before, may be i'm something missing, don't know, can't check it just now (i mean on linux).
Last edited by fddima on Wed May 16, 2012 1:02 pm, edited 1 time in total.
fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am

Re: CEF1/CEF3 using stdcall for CEF_CALLBACK on windows?

Postby fddima » Wed May 16, 2012 1:00 pm

magreenblatt wrote:The change sounds OK to me (or, at least, we can make it a build option). Please add an issue to the CEF issue tracker.

Added: http://code.google.com/p/chromiumembedd ... ail?id=598
Thanks!
fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am


Return to Feature Request Forum

Who is online

Users browsing this forum: No registered users and 23 guests