.. _program_listing_file__tmp_ws_src_ecl_lite_ecl_config_include_ecl_config_macros.hpp: Program Listing for File macros.hpp =================================== |exhale_lsh| :ref:`Return to documentation for file ` (``/tmp/ws/src/ecl_lite/ecl_config/include/ecl/config/macros.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp typename this_foo ECL_UNUSED other_foo; // in method arguments int foo (ECL_UNUSED int bar) { return 0; } #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 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); }; /***************************************************************************** ** Ifdefs *****************************************************************************/ #ifndef ECL_CONFIG_UTILITY_MACROS_HPP_ #define ECL_CONFIG_UTILITY_MACROS_HPP_ /***************************************************************************** ** Include *****************************************************************************/ #include /***************************************************************************** ** Macros *****************************************************************************/ #if (defined __GNUC__) #define ECL_DONT_INLINE __attribute__((noinline)) #elif (defined _MSC_VER) #define ECL_DONT_INLINE __declspec(noinline) #else #define ECL_DONT_INLINE #endif #if defined(__cplusplus) && (__cplusplus >= 201103L) #define ECL_CXX11_FOUND #else #define ECL_CXX11_NOT_FOUND #endif /***************************************************************************** ** Depracated *****************************************************************************/ #if (defined __GNUC__) #define ECL_DEPRECATED __attribute__((deprecated)) #elif (defined _MSC_VER) #define ECL_DEPRECATED __declspec(deprecated) #elif defined(__clang__) #define ECL_DEPRECATED __attribute__((deprecated("Use of this method is deprecated"))) #else #define ECL_DEPRECATED #endif /***************************************************************************** ** Unused *****************************************************************************/ #if (defined __GNUC__) || defined (__clang__) #define ECL_UNUSED __attribute__ ((unused)) #else #define ECL_UNUSED #endif /***************************************************************************** ** Visibility *****************************************************************************/ #if defined(ECL_IS_WIN32) || defined(ECL_IS_CYGWIN) #define ECL_HELPER_IMPORT __declspec(dllimport) #define ECL_HELPER_EXPORT __declspec(dllexport) #define ECL_HELPER_LOCAL #else #if defined(ECL_IS_POSIX) && __GNUC__ >= 4 #define ECL_HELPER_IMPORT __attribute__ ((visibility("default"))) #define ECL_HELPER_EXPORT __attribute__ ((visibility("default"))) #define ECL_HELPER_LOCAL __attribute__ ((visibility("hidden"))) #else #define ECL_HELPER_IMPORT #define ECL_HELPER_EXPORT #define ECL_HELPER_LOCAL #endif #endif // Until we depracate this entirely, need this to avoid being interpreted as a variable #define ECL_PUBLIC #define ECL_LOCAL #endif /* ECL_UTILITY_CONFIG_MACROS_HPP_ */