plibsys
|
Miscellaneous macros. More...
Go to the source code of this file.
Macros | |
#define | P_GNUC_WARN_UNUSED_RESULT |
Gives a warning if the result returned from a function is not being used. More... | |
#define | P_LIB_GLOBAL_API |
Marks a symbol (variable, function) as global. More... | |
#define | P_LIB_INTERNAL_API |
Marks a symbol (variable, function) as local. More... | |
#define | P_LIB_API P_LIB_GLOBAL_API |
Exports a symbol from a shared library. More... | |
#define | P_NO_RETURN |
Notifies a compiler that a function will never return a value (i.e. More... | |
#define | P_LIKELY(x) (x) |
Hints a compiler that a condition is likely to be true so it can perform code optimizations. More... | |
#define | P_UNLIKELY(x) (x) |
Hints a compiler that a condition is likely to be false so it can perform code optimizations. More... | |
#define | P_UNUSED(a) ((void) a) |
Macro to by-pass a compiler warning on unused variables. More... | |
#define | P_WARNING(msg) printf ("** Warning: %s **\n", msg) |
Prints a warning message. More... | |
#define | P_ERROR(msg) printf ("** Error: %s **\n", msg) |
Prints an error message. More... | |
#define | P_DEBUG(msg) printf ("** Debug: %s **\n", msg) |
Prints a debug message. More... | |
#define | PLIBSYS_VERSION_CHECK(major, minor, patch) ((major << 16) | (minor << 8) | (patch)) |
Makes a library version number which can be used to check the library version against which the application is compiled. More... | |
#define | P_BEGIN_DECLS |
Starts .h file declarations to be exported as C functions. More... | |
#define | P_END_DECLS |
Closes .h file declarations to be exported as C functions, should be always used after P_BEGIN_DECLS. More... | |
Miscellaneous macros.
All the macros are completely independent of any other platform-specific headers, thus gurantee to work with any compiler under any operating system in the same way as they are used within the library.
This family of macros provides various additional capabilities (compiler hints, attributes, version, etc.).
#define P_BEGIN_DECLS |
Starts .h file declarations to be exported as C functions.
#define P_DEBUG | ( | msg | ) | printf ("** Debug: %s **\n", msg) |
Prints a debug message.
msg | Message to print. |
#define P_END_DECLS |
Closes .h file declarations to be exported as C functions, should be always used after P_BEGIN_DECLS.
#define P_ERROR | ( | msg | ) | printf ("** Error: %s **\n", msg) |
Prints an error message.
msg | Message to print. |
#define P_GNUC_WARN_UNUSED_RESULT |
Gives a warning if the result returned from a function is not being used.
#define P_LIB_API P_LIB_GLOBAL_API |
Exports a symbol from a shared library.
#define P_LIB_GLOBAL_API |
Marks a symbol (variable, function) as global.
Global symbols are exported during the linkage and are available from the outside of the module they are defined in. Use it for public API.
#define P_LIB_INTERNAL_API |
Marks a symbol (variable, function) as local.
Local symbols are not exported during the linkage and are not available from the outside of the module they are defined in. Use it for internal API.
#define P_LIKELY | ( | x | ) | (x) |
Hints a compiler that a condition is likely to be true so it can perform code optimizations.
#define P_NO_RETURN |
Notifies a compiler that a function will never return a value (i.e.
due to the abort () call).
#define P_UNLIKELY | ( | x | ) | (x) |
Hints a compiler that a condition is likely to be false so it can perform code optimizations.
#define P_UNUSED | ( | a | ) | ((void) a) |
Macro to by-pass a compiler warning on unused variables.
#define P_WARNING | ( | msg | ) | printf ("** Warning: %s **\n", msg) |
Prints a warning message.
msg | Message to print. |
#define PLIBSYS_VERSION_CHECK | ( | major, | |
minor, | |||
patch | |||
) | ((major << 16) | (minor << 8) | (patch)) |
Makes a library version number which can be used to check the library version against which the application is compiled.
major | Major version number to check. |
minor | Minor version number to check. |
patch | Minor version number to check. |