Changeset 4898 for branches/erijo-dev

Show
Ignore:
Timestamp:
04/30/07 06:56:31 (19 months ago)
Author:
erijo
Message:

Use gcc visibility to hide symbols

Location:
branches/erijo-dev/licq
Files:
17 modified

Legend:

Unmodified
Added
Removed
  • branches/erijo-dev/licq/CMakeLists.txt

    r4883 r4898  
    4141endif (CXX_ACCEPTS_WEXTRA) 
    4242 
     43check_cxx_accepts_flag(-fvisibility=hidden CXX_ACCEPTS_VISIBILITY) 
     44if (CXX_ACCEPTS_VISIBILITY) 
     45  add_definitions(-fvisibility=hidden) 
     46#  add_definitions(-fvisibility-inlines-hidden) 
     47endif (CXX_ACCEPTS_VISIBILITY) 
     48 
    4349# dlopen policy 
    4450set(DLOPEN_POLICY RTLD_NOW) 
  • branches/erijo-dev/licq/licq/eventdispatcher.h

    r4884 r4898  
    2121#define LICQ_TEVENTDISPATCHER_H 
    2222 
     23#include "licq/licq.h" 
    2324#include "licq/interface/eventhandler.h" 
    2425 
     
    3132typedef boost::function<void (const IEventPtr&)> TEventCallback; 
    3233 
    33 class TEventDispatcher : public IEventHandler 
     34class LICQEXPORT TEventDispatcher : public IEventHandler 
    3435{ 
    3536private: 
  • branches/erijo-dev/licq/licq/eventloop.h

    r4881 r4898  
    2121#define LICQ_TEVENTLOOP_H 
    2222 
     23#include "licq/licq.h" 
    2324#include "licq/interface/eventhandler.h" 
    2425#include "licq/interface/eventqueue.h" 
     
    2728{ 
    2829 
    29 class TEventLoop 
     30class LICQEXPORT TEventLoop 
    3031{ 
    3132private: 
  • branches/erijo-dev/licq/licq/interface/daemon.h

    r4881 r4898  
    2121#define LICQ_IDAEMON_H 
    2222 
     23#include "licq/licq.h" 
    2324#include "licq/interface/event.h" 
    2425 
     
    2829{ 
    2930 
    30 class IDaemon 
     31class LICQEXPORT IDaemon 
    3132{ 
    3233protected: 
  • branches/erijo-dev/licq/licq/interface/event.h

    r4882 r4898  
    2121#define LICQ_IEVENT_H 
    2222 
     23#include "licq/licq.h" 
    2324#include "licq/types.h" 
    2425 
     
    4546    (key, value pairs). 
    4647*/ 
    47 class IEvent : private boost::noncopyable 
     48class LICQEXPORT IEvent : private boost::noncopyable 
    4849{ 
    4950protected: 
     
    5859      \return True if property exists; otherwise false. 
    5960  */ 
    60   virtual bool getProperty(const std::string& key,  
    61                const boost::any** value) const = 0; 
     61  virtual bool getProperty(const std::string& key, 
     62                           const boost::any** value) const = 0; 
    6263 
    6364public: 
  • branches/erijo-dev/licq/licq/interface/eventhandler.h

    r4881 r4898  
    2121#define LICQ_IEVENTHANDLER_H 
    2222 
     23#include "licq/licq.h" 
    2324#include "licq/interface/event.h" 
    2425 
     
    2627{ 
    2728 
    28 class ITimeoutHandler 
     29class LICQEXPORT ITimeoutHandler 
    2930{ 
    3031public: 
     
    3334}; 
    3435 
    35 class IFileDescriptorHandler 
     36class LICQEXPORT IFileDescriptorHandler 
    3637{ 
    3738public: 
     
    4041}; 
    4142 
    42 class IEventHandler 
     43class LICQEXPORT IEventHandler 
    4344{ 
    4445public: 
  • branches/erijo-dev/licq/licq/interface/eventqueue.h

    r4875 r4898  
    2121#define LICQ_IEVENTQUEUE_H 
    2222 
     23#include "licq/licq.h" 
    2324#include "licq/interface/event.h" 
    2425#include <boost/noncopyable.hpp> 
     
    4243    (or popAll()) to retreive the event(s). 
    4344*/ 
    44 class IEventQueue : private boost::noncopyable 
     45class LICQEXPORT IEventQueue : private boost::noncopyable 
    4546{ 
    4647protected: 
  • branches/erijo-dev/licq/licq/interface/log.h

    r4839 r4898  
    2121#define LICQ_ILOG_H 
    2222 
     23#include "licq/licq.h" 
    2324#include <cstdarg> 
    2425 
     
    3637    \brief A printf-styled logging facility. 
    3738*/ 
    38 class ILog 
     39class LICQEXPORT ILog 
    3940{ 
    4041public: 
  • branches/erijo-dev/licq/licq/interface/plugin.h

    r4868 r4898  
    2121#define LICQ_IPLUGIN_H 
    2222 
     23#include "licq/licq.h" 
    2324#include "licq/types.h" 
    2425#include "licq/interface/eventqueue.h" 
     
    3334    IPlugin is the interface that all plugins need to implement. 
    3435*/ 
    35 class IPlugin 
     36class LICQEXPORT IPlugin 
    3637{ 
    3738public: 
  • branches/erijo-dev/licq/licq/interface/pluginfactory.h

    r4870 r4898  
    2121#define LICQ_IPLUGINFACTORY_H 
    2222 
     23#include "licq/licq.h" 
     24#include "licq/types.h" 
    2325#include "licq/interface/log.h" 
    2426#include "licq/interface/plugin.h" 
    2527#include "licq/interface/plugininformation.h" 
    26 #include "licq/types.h" 
    2728 
    2829#include <string> 
     
    3839    within a dynamic library (shared loadable module or .so library). 
    3940*/ 
    40 class IPluginFactory 
     41class LICQEXPORT IPluginFactory 
    4142{ 
    4243public: 
     
    9899      \return A plugin factory instance. 
    99100  */ 
    100   Licq::IPluginFactory* licqCreatePluginFactory(); 
     101  LICQEXPORT Licq::IPluginFactory* licqCreatePluginFactory(); 
    101102 
    102103  /** \brief Called by the daemon to destroy the plugin factory for this library. 
     
    106107      licqCreatePluginFactory(). 
    107108  */ 
    108   void licqDestroyPluginFactory(Licq::IPluginFactory* factory); 
     109  LICQEXPORT void licqDestroyPluginFactory(Licq::IPluginFactory* factory); 
    109110 
    110111  /** \brief Get the API version the plugin was built with. 
     
    124125      \return LICQ_VERSION_PLUGIN_API 
    125126  */ 
    126   unsigned int licqGetPluginApiVersion(); 
     127  LICQEXPORT unsigned int licqGetPluginApiVersion(); 
    127128 
    128129} // extern "C" 
     130 
     131#define EXPORT_PLUGIN(FACTORY)                                   \ 
     132  Licq::IPluginFactory* licqCreatePluginFactory()                \ 
     133  {                                                              \ 
     134    return new FACTORY();                                        \ 
     135  }                                                              \ 
     136  void licqDestroyPluginFactory(Licq::IPluginFactory* factory)   \ 
     137  {                                                              \ 
     138    delete factory;                                              \ 
     139  }                                                              \ 
     140  unsigned int licqGetPluginApiVersion()                         \ 
     141  {                                                              \ 
     142    return LICQ_VERSION_PLUGIN_API;                              \ 
     143  } 
    129144 
    130145inline Licq::IPluginFactory::~IPluginFactory() 
  • branches/erijo-dev/licq/licq/interface/plugininformation.h

    r4879 r4898  
    2121#define LICQ_TPLUGININFORMATION_H 
    2222 
     23#include "licq/licq.h" 
    2324#include <boost/shared_ptr.hpp> 
    2425#include <string> 
     
    3940}; 
    4041 
    41 struct TPluginAuthor 
     42struct LICQEXPORT TPluginAuthor 
    4243{ 
    4344  std::string Name; 
     
    4647}; 
    4748 
    48 struct TPluginInformation 
     49struct LICQEXPORT TPluginInformation 
    4950{ 
    5051  unsigned int IntVersion; 
  • branches/erijo-dev/licq/licq/licq.h

    r4839 r4898  
    4444*/ 
    4545 
     46#if defined(__GNUC__) && __GNUC__ >= 4 
     47  #define LICQEXPORT __attribute__ ((visibility("default"))) 
     48  #define LICQLOCAL  __attribute__ ((visibility("hidden"))) 
     49#else 
     50  #define LICQEXPORT 
     51  #define LICQLOCAL 
    4652#endif 
     53 
     54#endif 
  • branches/erijo-dev/licq/licq/version.h

    r4828 r4898  
    2121#define LICQ_VERSION_H 
    2222 
     23#include "licq/licq.h" 
     24 
    2325#define LICQ_VERSION_MAJOR 1 
    2426#define LICQ_VERSION_MINOR 9 
     
    4143 
    4244#ifdef __GNUC__ 
    43 # define LICQ_VERSION_PLUGIN_API LICQ_MAKE_VERSION(__GNUC__, __GNUC_MINOR__, LICQ_VERSION_MAJOR) 
     45# define LICQ_VERSION_PLUGIN_API \ 
     46    LICQ_MAKE_VERSION(__GNUC__, __GNUC_MINOR__, LICQ_VERSION_MAJOR) 
    4447#else 
    4548# define LICQ_VERSION_PLUGIN_API LICQ_VERSION_MAJOR 
     
    5255    \see LICQ_VERSION 
    5356*/ 
    54 unsigned int getVersion(); 
     57extern LICQEXPORT unsigned int getVersion(); 
    5558 
    5659/** \return Licq's major version, e.g. 1 in version 1.2.3. 
    5760    \see LICQ_VERSION_MAJOR 
    5861*/ 
    59 unsigned int getVersionMajor(); 
     62extern LICQEXPORT unsigned int getVersionMajor(); 
    6063 
    6164/** \return Licq's minor version, e.g. 2 in version 1.2.3. 
    6265    \see LICQ_VERSION_MINOR 
    6366*/ 
    64 unsigned int getVersionMinor(); 
     67extern LICQEXPORT unsigned int getVersionMinor(); 
    6568 
    6669/** \return Licq's release version, e.g. 3 in version 1.2.3. 
    6770    \see LICQ_VERSION_RELEASE 
    6871*/ 
    69 unsigned int getVersionRelease(); 
     72extern LICQEXPORT unsigned int getVersionRelease(); 
    7073 
    7174/** \return Licq's plugin API version. 
    7275    \see LICQ_VERSION_PLUGIN_API 
    7376*/ 
    74 unsigned int getVersionPluginApi(); 
     77extern LICQEXPORT unsigned int getVersionPluginApi(); 
    7578 
    7679/** \return Licq's version as a string, e.g. "1.2.3". 
    7780    \see LICQ_VERSION_STRING 
    7881*/ 
    79 const char* getVersionString(); 
     82extern LICQEXPORT const char* getVersionString(); 
    8083 
    8184} // namespace Licq 
  • branches/erijo-dev/licq/src/event/tests/main.cpp

    r4883 r4898  
    1919 
    2020#define BOOST_AUTO_TEST_MAIN 
     21#pragma GCC visibility push(default) 
    2122#include <boost/test/auto_unit_test.hpp> 
     23#pragma GCC visibility pop 
  • branches/erijo-dev/licq/src/plugin/tests/main.cpp

    r4852 r4898  
    1919 
    2020#define BOOST_AUTO_TEST_MAIN 
     21#pragma GCC visibility push(default) 
    2122#include <boost/test/auto_unit_test.hpp> 
     23#pragma GCC visibility pop 
  • branches/erijo-dev/licq/src/tests/main.cpp

    r4828 r4898  
    1919 
    2020#define BOOST_AUTO_TEST_MAIN 
     21#pragma GCC visibility push(default) 
    2122#include <boost/test/auto_unit_test.hpp> 
     23#pragma GCC visibility pop 
  • branches/erijo-dev/licq/src/utils/tests/main.cpp

    r4827 r4898  
    1919 
    2020#define BOOST_AUTO_TEST_MAIN 
     21#pragma GCC visibility push(default) 
    2122#include <boost/test/auto_unit_test.hpp> 
     23#pragma GCC visibility pop