diff options
-rw-r--r-- | volk/include/volk/make_h.py | 14 | ||||
-rw-r--r-- | volk/include/volk/make_makefile_am.py | 2 |
2 files changed, 13 insertions, 3 deletions
diff --git a/volk/include/volk/make_h.py b/volk/include/volk/make_h.py index 81928e6b5..07e62939b 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 1e43634f6..af4467f37 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 = \ |