What is SAL_CALL in c++? -


can 1 explain me briefly.

what sal_call in c++?

it's #define used in openoffice.org. it's defined in sal/inc/sal/types.h 1 of:

#define sal_call #define sal_call __cdecl 

depending on platform being compiled for. looks it's set latter when _msc_ver (for microsoft) defined.

it's used when specifying functions like:

virtual void sal_call acquire() throw () { ++m_nrefcount; } 

which morphed into:

virtual void acquire() throw () { ++m_nrefcount; } 

for regular compilers and:

virtual void __cdecl acquire() throw () { ++m_nrefcount; } 

for microsoft.

as __cdecl means microsoft compiler, see here, extracted below:


microsoft specific

this default calling convention c , c++ programs. because stack cleaned caller, can vararg functions. __cdecl calling convention creates larger executables __stdcall, because requires each function call include stack cleanup code. following list shows implementation of calling convention.

 +------------------------+----------------------------+ | element                | implementation             | +------------------------+----------------------------+ | argument-passing order | right left              | +------------------------+----------------------------+ | stack-maintenance      | calling function pops  | |   responsibility       |   arguments stack | +------------------------+----------------------------+ | name-decoration        | underscore character (_)   | |   convention           |   prefixed names     | +------------------------+----------------------------+ | case-translation       | no case translation        | |   convention           |   performed                | +------------------------+----------------------------+ 

Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -