From 46fc5569785a63eff534d6e05dc71b6aa673799e Mon Sep 17 00:00:00 2001 From: Thomas Moulard <thomas.moulard@gmail.com> Date: Mon, 1 Nov 2010 18:53:16 +0100 Subject: [PATCH] Use generated config.hh header file for symbol visibility management. --- include/dynamic-graph/debug.h | 6 +++--- include/dynamic-graph/dynamic-graph-api.h | 16 +++------------- include/dynamic-graph/entity.h | 4 ++-- include/dynamic-graph/exception-abstract.h | 4 ++-- include/dynamic-graph/exception-factory.h | 2 +- include/dynamic-graph/exception-signal.h | 2 +- include/dynamic-graph/exception-traces.h | 2 +- include/dynamic-graph/factory.h | 6 +++--- include/dynamic-graph/functions.h | 2 +- include/dynamic-graph/interpreter-helper.h | 2 +- include/dynamic-graph/interpreter.h | 6 +++--- include/dynamic-graph/plugin-loader.h | 2 +- include/dynamic-graph/pool.h | 4 ++-- include/dynamic-graph/signal-array.h | 2 +- include/dynamic-graph/signal-caster.h | 4 ++-- src/CMakeLists.txt | 3 +++ 16 files changed, 30 insertions(+), 37 deletions(-) diff --git a/include/dynamic-graph/debug.h b/include/dynamic-graph/debug.h index 99e0148..ac4778f 100644 --- a/include/dynamic-graph/debug.h +++ b/include/dynamic-graph/debug.h @@ -73,7 +73,7 @@ namespace dynamicgraph { -class DYNAMICGRAPH_EXPORT DebugTrace +class DYNAMIC_GRAPH_DLLAPI DebugTrace { public: static const int SIZE = 512; @@ -110,8 +110,8 @@ class DYNAMICGRAPH_EXPORT DebugTrace }; -DYNAMICGRAPH_EXPORT extern DebugTrace dgDEBUGFLOW; -DYNAMICGRAPH_EXPORT extern DebugTrace dgERRORFLOW; +DYNAMIC_GRAPH_DLLAPI extern DebugTrace dgDEBUGFLOW; +DYNAMIC_GRAPH_DLLAPI extern DebugTrace dgERRORFLOW; } // namespace dynamicgraph diff --git a/include/dynamic-graph/dynamic-graph-api.h b/include/dynamic-graph/dynamic-graph-api.h index 201d6e9..3d3975c 100644 --- a/include/dynamic-graph/dynamic-graph-api.h +++ b/include/dynamic-graph/dynamic-graph-api.h @@ -19,16 +19,6 @@ */ #ifndef DYNAMICGRAPH_API_H -#define DYNAMICGRAPH_API_H - -#if defined (WIN32) -# ifdef dynamic_graph_EXPORTS -# define DYNAMICGRAPH_EXPORT __declspec(dllexport) -# else -# define DYNAMICGRAPH_EXPORT __declspec(dllimport) -# endif -#else -# define DYNAMICGRAPH_EXPORT -#endif - -#endif +# define DYNAMICGRAPH_API_H +# include <dynamic-graph/config.hh> +#endif //! DYNAMICGRAPH_API_H diff --git a/include/dynamic-graph/entity.h b/include/dynamic-graph/entity.h index b2c800f..abd2308 100644 --- a/include/dynamic-graph/entity.h +++ b/include/dynamic-graph/entity.h @@ -56,7 +56,7 @@ namespace dynamicgraph { call methods from entities and display the result of their execution. Classes that derive from Entity can customize the command-line by overriding commandLine(). */ -class DYNAMICGRAPH_EXPORT Entity +class DYNAMIC_GRAPH_DLLAPI Entity : private boost::noncopyable { @@ -99,7 +99,7 @@ class DYNAMICGRAPH_EXPORT Entity virtual const std::string& getCommandList( void ) const; }; -DYNAMICGRAPH_EXPORT std::ostream& operator<< (std::ostream& os, const dynamicgraph::Entity& ent ); +DYNAMIC_GRAPH_DLLAPI std::ostream& operator<< (std::ostream& os, const dynamicgraph::Entity& ent ); } // namespace dynamicgraph #endif /* #ifndef __ENTITY_HH__ */ diff --git a/include/dynamic-graph/exception-abstract.h b/include/dynamic-graph/exception-abstract.h index 427e2e5..5d3a5e7 100644 --- a/include/dynamic-graph/exception-abstract.h +++ b/include/dynamic-graph/exception-abstract.h @@ -43,7 +43,7 @@ namespace dynamicgraph { /* \class ExceptionAbstract */ -class DYNAMICGRAPH_EXPORT ExceptionAbstract : public std::exception +class DYNAMIC_GRAPH_DLLAPI ExceptionAbstract : public std::exception { public: @@ -94,7 +94,7 @@ public: } /** Print the error structure. */ - DYNAMICGRAPH_EXPORT friend std::ostream & operator << (std::ostream & os, + DYNAMIC_GRAPH_DLLAPI friend std::ostream & operator << (std::ostream & os, const ExceptionAbstract & err); #ifdef DYNAMICGRAPH_EXCEPTION_PASSING_PARAM diff --git a/include/dynamic-graph/exception-factory.h b/include/dynamic-graph/exception-factory.h index da662b2..19ffec4 100644 --- a/include/dynamic-graph/exception-factory.h +++ b/include/dynamic-graph/exception-factory.h @@ -37,7 +37,7 @@ namespace dynamicgraph { /* \class sotExceptionFactory */ -class DYNAMICGRAPH_EXPORT ExceptionFactory +class DYNAMIC_GRAPH_DLLAPI ExceptionFactory :public ExceptionAbstract { diff --git a/include/dynamic-graph/exception-signal.h b/include/dynamic-graph/exception-signal.h index d0755f3..c9fa1ba 100644 --- a/include/dynamic-graph/exception-signal.h +++ b/include/dynamic-graph/exception-signal.h @@ -37,7 +37,7 @@ namespace dynamicgraph { /* \class sotExceptionSignal */ -class DYNAMICGRAPH_EXPORT ExceptionSignal +class DYNAMIC_GRAPH_DLLAPI ExceptionSignal :public ExceptionAbstract { diff --git a/include/dynamic-graph/exception-traces.h b/include/dynamic-graph/exception-traces.h index 90a6d1b..81e8bc1 100644 --- a/include/dynamic-graph/exception-traces.h +++ b/include/dynamic-graph/exception-traces.h @@ -37,7 +37,7 @@ namespace dynamicgraph { /* \class ExceptionTraces */ -class DYNAMICGRAPH_EXPORT ExceptionTraces +class DYNAMIC_GRAPH_DLLAPI ExceptionTraces :public ExceptionAbstract { diff --git a/include/dynamic-graph/factory.h b/include/dynamic-graph/factory.h index e002797..1de0256 100644 --- a/include/dynamic-graph/factory.h +++ b/include/dynamic-graph/factory.h @@ -50,7 +50,7 @@ class Entity; * * */ -class DYNAMICGRAPH_EXPORT FactoryStorage +class DYNAMIC_GRAPH_DLLAPI FactoryStorage { public: @@ -79,7 +79,7 @@ class DYNAMICGRAPH_EXPORT FactoryStorage }; -DYNAMICGRAPH_EXPORT extern FactoryStorage g_factory; +DYNAMIC_GRAPH_DLLAPI extern FactoryStorage g_factory; /* --- REGISTERER ----------------------------------------------------------- */ /* --- REGISTERER ----------------------------------------------------------- */ @@ -92,7 +92,7 @@ DYNAMICGRAPH_EXPORT extern FactoryStorage g_factory; /*! A helper class to register an entity. * */ -class DYNAMICGRAPH_EXPORT EntityRegisterer +class DYNAMIC_GRAPH_DLLAPI EntityRegisterer { private: EntityRegisterer( void ); diff --git a/include/dynamic-graph/functions.h b/include/dynamic-graph/functions.h index 7b42c3c..9530a2f 100644 --- a/include/dynamic-graph/functions.h +++ b/include/dynamic-graph/functions.h @@ -54,7 +54,7 @@ and user interaction commands such as display and beep commands. For more information, load the plugin and type help on a sot shell. */ -class DYNAMICGRAPH_EXPORT ShellFunctions +class DYNAMIC_GRAPH_DLLAPI ShellFunctions { public: diff --git a/include/dynamic-graph/interpreter-helper.h b/include/dynamic-graph/interpreter-helper.h index 04dd613..ff2aedf 100644 --- a/include/dynamic-graph/interpreter-helper.h +++ b/include/dynamic-graph/interpreter-helper.h @@ -59,7 +59,7 @@ namespace dynamicgraph { \li get a signal, \li compute a signal, */ -class DYNAMICGRAPH_EXPORT InterpreterHelper +class DYNAMIC_GRAPH_DLLAPI InterpreterHelper { public: diff --git a/include/dynamic-graph/interpreter.h b/include/dynamic-graph/interpreter.h index 798d709..0439b77 100644 --- a/include/dynamic-graph/interpreter.h +++ b/include/dynamic-graph/interpreter.h @@ -61,7 +61,7 @@ class PluginLoader; \li compute a signal, \li act as a proxy for the commands of the plugins. */ -class DYNAMICGRAPH_EXPORT Interpreter +class DYNAMIC_GRAPH_DLLAPI Interpreter { public: @@ -187,7 +187,7 @@ class DYNAMICGRAPH_EXPORT Interpreter * Use the macro DYNAMIC-GRAPH_SHELL_FUNCTION_REGISTERER(name, fun) in a .cpp file * to register functions on plugin load. */ -class DYNAMICGRAPH_EXPORT ShellFunctionRegisterer +class DYNAMIC_GRAPH_DLLAPI ShellFunctionRegisterer { public: @@ -200,7 +200,7 @@ public: ShellFunctionRegisterer reg( name,boost::bind(fun,_1,_2,_3) );\ } -DYNAMICGRAPH_EXPORT extern Interpreter g_shell; +DYNAMIC_GRAPH_DLLAPI extern Interpreter g_shell; } // namespace dynamicgraph diff --git a/include/dynamic-graph/plugin-loader.h b/include/dynamic-graph/plugin-loader.h index 18fd14d..70e4468 100644 --- a/include/dynamic-graph/plugin-loader.h +++ b/include/dynamic-graph/plugin-loader.h @@ -52,7 +52,7 @@ class PluginRefMap; example. */ -class DYNAMICGRAPH_EXPORT PluginLoader +class DYNAMIC_GRAPH_DLLAPI PluginLoader { protected: diff --git a/include/dynamic-graph/pool.h b/include/dynamic-graph/pool.h index 0c4daac..a24fbcc 100644 --- a/include/dynamic-graph/pool.h +++ b/include/dynamic-graph/pool.h @@ -64,7 +64,7 @@ class Entity; It also returns signal. */ -class DYNAMICGRAPH_EXPORT PoolStorage +class DYNAMIC_GRAPH_DLLAPI PoolStorage { public: /*! \name Define types to simplify the writing @@ -131,7 +131,7 @@ class DYNAMICGRAPH_EXPORT PoolStorage void writeCompletionList(std::ostream& os); }; -DYNAMICGRAPH_EXPORT extern dynamicgraph::PoolStorage g_pool; +DYNAMIC_GRAPH_DLLAPI extern dynamicgraph::PoolStorage g_pool; } // namespace dynamicgraph diff --git a/include/dynamic-graph/signal-array.h b/include/dynamic-graph/signal-array.h index 22db5a7..3757818 100644 --- a/include/dynamic-graph/signal-array.h +++ b/include/dynamic-graph/signal-array.h @@ -169,7 +169,7 @@ SignalArray<Time> operator<<( SignalBase<Time>& sig1, return res; } - DYNAMICGRAPH_EXPORT extern SignalArray<int> sotNOSIGNAL; + DYNAMIC_GRAPH_DLLAPI extern SignalArray<int> sotNOSIGNAL; } // namespace dynamicgraph diff --git a/include/dynamic-graph/signal-caster.h b/include/dynamic-graph/signal-caster.h index 4ceb039..f0b589a 100644 --- a/include/dynamic-graph/signal-caster.h +++ b/include/dynamic-graph/signal-caster.h @@ -42,7 +42,7 @@ namespace dynamicgraph { * complex than a typical template-based compile-time resolve. So disp, cast and * trace are costly functions and should be used as such. */ -class DYNAMICGRAPH_EXPORT SignalCaster { +class DYNAMIC_GRAPH_DLLAPI SignalCaster { public: SignalCaster(); virtual ~SignalCaster(); @@ -78,7 +78,7 @@ private: /// The library-wide instance of SignalCaster -extern DYNAMICGRAPH_EXPORT SignalCaster g_caster; +extern DYNAMIC_GRAPH_DLLAPI SignalCaster g_caster; /*! * The SignalCast registerer class. Can be used to automatically register a cast when diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4f7749f..618d6a6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -23,6 +23,9 @@ IF (NOT (\"${CMAKE_VERBOSITY_LEVEL}\" STREQUAL \"\")) ADD_DEFINITIONS(-DVP_DEBUG_MODE=${CMAKE_VERBOSITY_LEVEL} -DVP_DEBUG) ENDIF (NOT (\"${CMAKE_VERBOSITY_LEVEL}\" STREQUAL \"\")) +# Declare that dynamic-graph shared library is being built. +ADD_DEFINITIONS(-DBUILDING_DYNAMIC_GRAPH) + ADD_LIBRARY(${LIBRARY_NAME} SHARED debug/debug.cpp -- GitLab