Permalink
Browse files

Explicitly set visibility of getFactoryMap to "default".

This enables the user to export only getFactoryMap
from his component by compiling with -fvisibility=hidden,
as recommended in the DSO HOWTO
(www.akkadia.org/drepper/dsohowto.pdf).
  • Loading branch information...
1 parent 15399fa commit e998f8a0e329749b2d3e6fce0dd51efb3ad9cb31 @avm committed Jul 26, 2012
Showing with 9 additions and 1 deletion.
  1. +9 −1 include/fastcgi2/component_factory.h
@@ -55,8 +55,16 @@ class DefaultComponentFactory : public ComponentFactory {
typedef fastcgi::FactoryMap* (*FastcgiGetFactoryMapFunction)();
+#if __GNUC__ >= 4
+# define FCGIDAEMON_DSO_GLOBALLY_VISIBLE \
+ __attribute__ ((visibility ("default")))
+#else
+# define FCGIDAEMON_DSO_GLOBALLY_VISIBLE
+#endif
+
#define FCGIDAEMON_REGISTER_FACTORIES_BEGIN() \
- extern "C" const fastcgi::FactoryMap* getFactoryMap() { \
+ extern "C" FCGIDAEMON_DSO_GLOBALLY_VISIBLE \
+ const fastcgi::FactoryMap* getFactoryMap() { \
static fastcgi::FactoryMap m;
#define FCGIDAEMON_ADD_DEFAULT_FACTORY(name, Type) \

0 comments on commit e998f8a

Please sign in to comment.