Macros
macros.hpp File Reference

Various macros useful for development. More...

#include <ecl/config/ecl.hpp>
Include dependency graph for macros.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ECL_CXX11_NOT_FOUND
 C++11 support is available. More...
 
#define ECL_DEPRECATED
 Deprecated compiler warnings. More...
 
#define ECL_DONT_INLINE
 Prevents a function from being inlined. More...
 
#define ECL_HELPER_EXPORT
 Declare public visibility for libraries. More...
 
#define ECL_HELPER_IMPORT
 
#define ECL_HELPER_LOCAL
 
#define ECL_LOCAL
 
#define ECL_PUBLIC
 

Detailed Description

Various macros useful for development.

Date
September 2010

Definition in file macros.hpp.

Macro Definition Documentation

◆ ECL_HELPER_EXPORT

#define ECL_HELPER_EXPORT

Declare public visibility for libraries.

This emits (in a cross platform way) the required symbols for setting whether a function/class should be visible or hidden. Note only does this protect the private parts of your library, but it can also greatly speed up the linking process.

To check what symbols are being exported for a gnu library,

nm -C -D <library>.so

Usage:

Each package needs to create it's own macro to make use of the macro that cmake defines for library targets:

#ifdef ROS_BUILD_SHARED_LIBS // ros is being built around shared libraries
#ifdef ecl_common_EXPORTS // we are building a shared lib/dll
#define ecl_common_PUBLIC ROS_HELPER_EXPORT
#else // we are using shared lib/dll
#define ecl_common_PUBLIC ROS_HELPER_IMPORT
#endif
#else // ros is being built around static libraries
#define ecl_common_DECL
#endif

And use it alongside class or function definitions:

extern "C" ecl_common_PUBLIC void function(int a);
class ecl_common_PUBLIC SomeClass {
int c;
ecl_common_LOCAL void privateMethod(); // Only for use within this DSO
public:
Person(int _c) : c(_c) { }
static void foo(int a);
};
See also
ECL_HELPER_IMPORT, ECL_HELPER_LOCAL

Definition at line 163 of file macros.hpp.

◆ ECL_HELPER_IMPORT

#define ECL_HELPER_IMPORT
See also
ECL_HELPER_EXPORT, ECL_HELPER_LOCAL

Definition at line 162 of file macros.hpp.

◆ ECL_HELPER_LOCAL

#define ECL_HELPER_LOCAL
See also
ECL_HELPER_EXPORT, ECL_HELPER_IMPORT

Definition at line 164 of file macros.hpp.

◆ ECL_LOCAL

#define ECL_LOCAL

Definition at line 170 of file macros.hpp.

◆ ECL_PUBLIC

#define ECL_PUBLIC

Definition at line 169 of file macros.hpp.



ecl_config
Author(s): Daniel Stonier
autogenerated on Mon Feb 28 2022 22:16:09