Which C calling convention does CEF use on Windows?

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Which C calling convention does CEF use on Windows?

Postby cybersight » Thu Jan 18, 2024 11:20 pm

For callbacks, CEF seems to be using stdcall based on the CEF_CALLBACK macro defined in cef_export.h. But what about top level functions like cef_initialize and cef_execute_process? Do they also use stdcall, or just cdecl?

Code: Select all
cef_export.h

#if defined(OS_WIN)
#define CEF_CALLBACK __stdcall
#else
#define CEF_CALLBACK
#endif
cybersight
Techie
 
Posts: 38
Joined: Mon Dec 11, 2023 11:04 am

Re: Which C calling convention does CEF use on Windows?

Postby magreenblatt » Thu Jan 18, 2024 11:53 pm

From the same file:

Code: Select all
#define CEF_EXPORT __declspec(dllexport)
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Which C calling convention does CEF use on Windows?

Postby cybersight » Fri Jan 19, 2024 1:13 am

magreenblatt wrote:From the same file:

Code: Select all
#define CEF_EXPORT __declspec(dllexport)


I'm not a C programmer and that line doesn't mention cdecl OR stdcall so it doesn't mean anything to me.

Also, https://stackoverflow.com/a/8036188 says that __declspec(dllexport) has no influence on calling convention.

Can you provide a clearer answer?
cybersight
Techie
 
Posts: 38
Joined: Mon Dec 11, 2023 11:04 am

Re: Which C calling convention does CEF use on Windows?

Postby magreenblatt » Fri Jan 19, 2024 10:50 am

Sorry for being unclear. cdecl is the default calling convention for C and C++ programs. See https://learn.microsoft.com/en-us/cpp/c ... w=msvc-170
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Which C calling convention does CEF use on Windows?

Postby cybersight » Fri Jan 19, 2024 11:06 pm

magreenblatt wrote:Sorry for being unclear. cdecl is the default calling convention for C and C++ programs. See https://learn.microsoft.com/en-us/cpp/c ... w=msvc-170


Thanks :)

I know Win32 system calls use stdcall, so I wasn't sure if that made it the default on Windows even though cdecl is the default in general.
cybersight
Techie
 
Posts: 38
Joined: Mon Dec 11, 2023 11:04 am


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 212 guests