summaryrefslogtreecommitdiff
path: root/volk/include
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-04-17 19:37:44 -0700
committerJosh Blum <josh@joshknows.com>2011-04-17 23:04:10 -0700
commitb31f891208f8a1c3605f4db2297cc6b6f4b37aca (patch)
tree13ffeef7c930080464351cd614ab779a046e9a4d /volk/include
parent0b3e4f25eea1eef3e8a45fdb6d1bcc1ec57d1321 (diff)
volk: added VOLK_API macro to external symbols
Diffstat (limited to 'volk/include')
-rw-r--r--volk/include/volk/make_h.py14
-rw-r--r--volk/include/volk/make_makefile_am.py2
2 files changed, 13 insertions, 3 deletions
diff --git a/volk/include/volk/make_h.py b/volk/include/volk/make_h.py
index 81928e6b58..07e62939bd 100644
--- a/volk/include/volk/make_h.py
+++ b/volk/include/volk/make_h.py
@@ -2,7 +2,14 @@ from xml.dom import minidom
from emit_omnilog import *
from volk_regexp import *
-
+# http://gcc.gnu.org/wiki/Visibility
+volk_api_defines = """
+#ifdef volk_EXPORTS
+# define VOLK_API __VOLK_ATTR_EXPORT
+#else
+# define VOLK_API __VOLK_ATTR_IMPORT
+#endif
+"""
def make_h(funclist, arched_arglist) :
tempstring = "";
@@ -14,15 +21,16 @@ def make_h(funclist, arched_arglist) :
tempstring = tempstring + '#include<volk/volk_config_fixed.h>\n';
tempstring = tempstring + '#include<volk/volk_attributes.h>\n';
tempstring = tempstring + '#include<volk/volk_complex.h>\n';
+ tempstring = tempstring + volk_api_defines
tempstring = tempstring + emit_prolog();
tempstring = tempstring + '\n';
for i in range(len(funclist)):
tempstring += "extern " + replace_volk.sub("p", funclist[i]) + " " + funclist[i] + ";\n"
- tempstring += "extern void %s_manual%s;\n" % (funclist[i], arched_arglist[i])
+ tempstring += "extern VOLK_API void %s_manual%s;\n" % (funclist[i], arched_arglist[i])
tempstring = strip_trailing(tempstring, " {")
- tempstring += "extern struct volk_func_desc %s_get_func_desc(void);\n" % (funclist[i])
+ tempstring += "extern VOLK_API struct volk_func_desc %s_get_func_desc(void);\n" % (funclist[i])
tempstring = tempstring + emit_epilog();
tempstring = tempstring + "#endif /*INCLUDED_VOLK_RUNTIME*/\n";
diff --git a/volk/include/volk/make_makefile_am.py b/volk/include/volk/make_makefile_am.py
index 1e43634f63..af4467f373 100644
--- a/volk/include/volk/make_makefile_am.py
+++ b/volk/include/volk/make_makefile_am.py
@@ -26,6 +26,8 @@ include $(top_srcdir)/Makefile.common
AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) \
-I$(top_builddir)/include \
+ -Dvolk_EXPORTS \
+ -fvisibility=hidden \
$(WITH_INCLUDES)
lib_LTLIBRARIES = \