Boost logo

Boost :

From: Jason Kankiewicz (jkankiewicz_at_[hidden])
Date: 2005-11-29 16:27:25


Boost.Python's sources only deal with GCC's "-fvisibility=hidden" option
  for versions [3.5 - 3.9]. It should also work properly when built with
GCC 4 and higher. The attached patches to boost/python/detail/config.hpp
and boost/python/module_init.hpp enable it to do so.

Tested with GCC 4.0 (XCode 2.2) on OSX 10.4.3 (Tiger).

--
Jason Kankiewicz
Advanced Publishing Technology, Inc.

Index: boost/python/detail/config.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/python/detail/config.hpp,v
retrieving revision 1.37
diff -u -r1.37 config.hpp
--- boost/python/detail/config.hpp 29 Nov 2004 21:32:14 -0000 1.37
+++ boost/python/detail/config.hpp 29 Nov 2005 20:29:13 -0000
@@ -67,9 +67,8 @@
 #endif
 
 #if defined(BOOST_PYTHON_DYNAMIC_LIB)
-
-# if !defined(_WIN32) && !defined(__CYGWIN__) \
- && defined(__GNUC__) && __GNUC__ >= 3 && __GNUC_MINOR__ >=5 \
+# if !defined(_WIN32) && !defined(__CYGWIN__) \
+ && defined(__GNUC__) && ((__GNUC__ >= 3 && __GNUC_MINOR__ >=5) || __GNUC__ >= 4) \
     && !defined(BOOST_PYTHON_GCC_SYMBOL_VISIBILITY)
 # define BOOST_PYTHON_USE_GCC_SYMBOL_VISIBILITY
 # endif

Index: boost/python/module_init.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/python/module_init.hpp,v
retrieving revision 1.6
diff -u -r1.6 module_init.hpp
--- boost/python/module_init.hpp 20 Sep 2004 12:47:31 -0000 1.6
+++ boost/python/module_init.hpp 29 Nov 2005 20:29:13 -0000
@@ -42,7 +42,7 @@
 } \
 void init_module_##name()
 
-# elif (defined(__GNUC__) && __GNUC__ >= 3 && __GNUC_MINOR__ >=5)
+# elif (defined(__GNUC__) && ((__GNUC__ >= 3 && __GNUC_MINOR__ >=5) || __GNUC__ >= 4))
 
 # define BOOST_PYTHON_MODULE_INIT(name) \
 void init_module_##name(); \


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk