|
Open Client Client-Library/C Reference Manual
|
Declare callbacks with CS_PUBLIC
All of an application's Client-Library and CS-Library
callbacks must be declared with CS_PUBLIC.
On some platforms (such as Windows), a compiler may use one of many
calling conventions for functions in generated code. A function's
calling convention determines how the machine registers and the machine
stack are manipulated when the function is called. The compiler generates
different machine instructions for different calling conventions. CS_PUBLIC
(along with any required compiler options) ensures that the application's
callbacks are compiled with the same calling convention with which
Client-Library invokes them.
Compiler options are described in the Open
Client/Server Programmer's Supplement.
On many platforms, CS_PUBLIC is defined such that
it adds nothing to a function declaration. On these platforms, applications
that declare callbacks with CS_PUBLIC behave no differently
than those that omit CS_PUBLIC. However, for portability,
CS_PUBLIC should be used to declare callbacks on any platform.