Symbol visibility
Defines

Macros for controlling inter-module symbol visibility and linkage.

Macros for controlling inter-module symbol visibility and linkage.

These macros have platform specific values. CP_EXPORT, CP_IMPORT and CP_HIDDEN can be reused by plug-in implementations for better portability. The complexity is mostly due to Windows DLL exports and imports.

Each module should usually define its own macro to declare API symbols with CP_EXPORT and CP_IMPORT as necessary. For example, a mobule could define a macro `MY_API` in the API header file as follows.

#ifndef MY_API
# define MY_API CP_IMPORT
#endif

By default the API symbols would then be marked for import which is correct when client modules are including the API header file. When compiling the module itself the option `-DMY_API=CP_EXPORT` would be passed to the compiler to override the API header file and to mark the API symbols for export. The overriding definition could also be included in module source files or in an internal header file before including the API header file.

Generated on Sun Mar 31 2024 17:56:45 for C-Pluff C API by 1.9.8