aboutsummaryrefslogtreecommitdiffstats
path: root/host/python/pyuhd.cpp
diff options
context:
space:
mode:
authorMarcus Müllr <marcus.mueller@ettus.com>2018-07-27 14:47:31 +0000
committerBrent Stapleton <bstapleton@g.hmc.edu>2018-08-03 16:26:33 -0700
commit89eac133eab2e4bcd5f67544fe0ca888f5e7df9e (patch)
treed55c3d166bfe1b3b92d0bdd226335242fbd16ac8 /host/python/pyuhd.cpp
parent65bd6aebeb9a0e26e02b1f7141abd9dec570e462 (diff)
downloaduhd-89eac133eab2e4bcd5f67544fe0ca888f5e7df9e.tar.gz
uhd-89eac133eab2e4bcd5f67544fe0ca888f5e7df9e.tar.bz2
uhd-89eac133eab2e4bcd5f67544fe0ca888f5e7df9e.zip
python: Fixing Boost.Python initializer visibility
With Boost 1.64 to 1.65 (which, of course, Ubuntu LTS ships), the `PyInit_Libraryname` are invisible when one sets the default visibility to "hidden" (which is reasonable, and which we do).
Diffstat (limited to 'host/python/pyuhd.cpp')
-rw-r--r--host/python/pyuhd.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/host/python/pyuhd.cpp b/host/python/pyuhd.cpp
index fe8d6a790..27b154c90 100644
--- a/host/python/pyuhd.cpp
+++ b/host/python/pyuhd.cpp
@@ -9,6 +9,17 @@
#include <boost/python/stl_iterator.hpp>
#include <boost/python/suite/indexing/vector_indexing_suite.hpp>
+/*
+This solution was adapted from an Issue posted to the Boost.Python Github.
+https://github.com/boostorg/python/pull/159/files
+*/
+#if (BOOST_VERSION >= 106400) && (BOOST_VERSION < 106600)
+#warning overriding broken boost python implementation of BOOST_PYTHON_MODULE_INIT
+# define BOOST_PYTHON_MODULE_INIT(name) \
+ void BOOST_PP_CAT(init_module_,name)(); \
+extern "C" BOOST_SYMBOL_EXPORT _BOOST_PYTHON_MODULE_INIT(name)
+#endif
+
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
#include <numpy/arrayobject.h>