diff options
author | Josh Blum | 2011-05-06 12:41:16 -0700 |
---|---|---|
committer | Josh Blum | 2011-05-06 12:41:16 -0700 |
commit | 5b4c7d27e9d49ab58df1f1d9350dcaf64c60a1ce (patch) | |
tree | f90d624a0e9973cd5876030c862395466b6ba64d | |
parent | 12413747c90754482582e16c95b551e1b36c6074 (diff) | |
download | gnuradio-5b4c7d27e9d49ab58df1f1d9350dcaf64c60a1ce.tar.gz gnuradio-5b4c7d27e9d49ab58df1f1d9350dcaf64c60a1ce.tar.bz2 gnuradio-5b4c7d27e9d49ab58df1f1d9350dcaf64c60a1ce.zip |
volk: top-level common header cleanup
Since we already have a volk_common.h,
moved the attributes, API declaration,
and c-linkage macros into volk_common.h
This change removes volk_attributes.h,
in favor of one common include header.
The implementation headers that require
attributes now include volk_common.h
This change removes the emit_omnilog.py script,
in favor of pre-processor macros in volk_common.h
In addition, extern C is only defined when in C++
and in GCC because non-GCC does not have complex.h
32 files changed, 101 insertions, 126 deletions
diff --git a/volk/gen/emit_omnilog.py b/volk/gen/emit_omnilog.py deleted file mode 100644 index 309d7e578..000000000 --- a/volk/gen/emit_omnilog.py +++ /dev/null @@ -1,13 +0,0 @@ -def emit_prolog(): - tempstring = ""; - tempstring = tempstring + '#ifdef __cplusplus\n'; - tempstring = tempstring + 'extern "C" {\n'; - tempstring = tempstring + '#endif\n'; - return tempstring; -def emit_epilog(): - tempstring = ""; - tempstring = tempstring + '#ifdef __cplusplus\n'; - tempstring = tempstring + '}\n'; - tempstring = tempstring + '#endif\n'; - return tempstring; - diff --git a/volk/gen/make_c.py b/volk/gen/make_c.py index 3fe604f39..4e67f31ff 100644 --- a/volk/gen/make_c.py +++ b/volk/gen/make_c.py @@ -17,7 +17,6 @@ from volk_regexp import * import string -from emit_omnilog import * #ok todo list: #put n_archs into the info struct so it doesn't have to be arch_defs[0]. @@ -38,8 +37,7 @@ def make_c(machines, archs, functions, arched_arglist, my_arglist): #include <string.h> """ - tempstring += emit_prolog(); - + #OK here's the deal. the .h prototypes the functions. the .c impls them as fptrs, can use p_whatever. #also .c impls the get_machine call #also .c impls the default call for each fn @@ -93,8 +91,6 @@ static unsigned int get_index(const char *indices[], unsigned int n_archs, const tempstring += " struct volk_func_desc desc = {get_machine()->%s_indices, get_machine()->%s_arch_defs, get_machine()->%s_n_archs};\n" % (functions[i], functions[i], functions[i]) tempstring += " return desc;\n}\n" - tempstring += emit_epilog(); - return tempstring diff --git a/volk/gen/make_cpuid_h.py b/volk/gen/make_cpuid_h.py index cd3da2455..4fe5c4e07 100644 --- a/volk/gen/make_cpuid_h.py +++ b/volk/gen/make_cpuid_h.py @@ -21,14 +21,14 @@ # from xml.dom import minidom -from emit_omnilog import * def make_cpuid_h(dom) : tempstring = ""; tempstring = tempstring +'/*this file is auto generated by volk_register.py*/'; tempstring = tempstring +'\n#ifndef INCLUDED_VOLK_CPU_H'; tempstring = tempstring +'\n#define INCLUDED_VOLK_CPU_H\n\n'; - tempstring = tempstring + emit_prolog(); + tempstring = tempstring + "#include <volk/volk_common.h>\n\n"; + tempstring = tempstring + '__VOLK_DECL_BEGIN\n'; tempstring = tempstring + '\n' tempstring = tempstring + "struct VOLK_CPU {\n" @@ -42,7 +42,7 @@ def make_cpuid_h(dom) : tempstring = tempstring + "unsigned int volk_get_lvarch ();\n" tempstring = tempstring + "\n"; - tempstring = tempstring + emit_epilog(); + tempstring = tempstring + "__VOLK_DECL_END\n"; tempstring = tempstring + "#endif /*INCLUDED_VOLK_CPU_H*/\n" return tempstring; diff --git a/volk/gen/make_each_machine_c.py b/volk/gen/make_each_machine_c.py index 4e6684745..6d9b8c65f 100644 --- a/volk/gen/make_each_machine_c.py +++ b/volk/gen/make_each_machine_c.py @@ -17,7 +17,6 @@ from volk_regexp import * import string -from emit_omnilog import * def make_each_machine_c(machine_name, archs, functions, fcountlist, taglist): @@ -47,7 +46,6 @@ def make_each_machine_c(machine_name, archs, functions, fcountlist, taglist): #include <volk/volk_config_fixed.h> """ - tempstring += emit_prolog(); for func in functions: tempstring += "#include <volk/" + func + ".h>\n" tempstring += "\n\n" @@ -66,7 +64,6 @@ def make_each_machine_c(machine_name, archs, functions, fcountlist, taglist): tempstring = strip_trailing(tempstring, ",") tempstring += "};\n" - tempstring += emit_epilog(); return tempstring diff --git a/volk/gen/make_environment_init_h.py b/volk/gen/make_environment_init_h.py index 77a841a24..655d73f54 100644 --- a/volk/gen/make_environment_init_h.py +++ b/volk/gen/make_environment_init_h.py @@ -1,5 +1,4 @@ from xml.dom import minidom -from emit_omnilog import * def make_environment_init_h() : tempstring = ""; @@ -7,9 +6,10 @@ def make_environment_init_h() : tempstring = tempstring + "#ifndef INCLUDE_LIBVECTOR_ENVIRONMENT_INIT_H\n"; tempstring = tempstring + "#define INCLUDE_LIBVECTOR_ENVIRONMENT_INIT_H\n"; tempstring = tempstring + "\n"; - tempstring = tempstring + emit_prolog(); + tempstring = tempstring + "#include <volk/volk_common.h>\n\n"; + tempstring = tempstring + "__VOLK_DECL_BEGIN\n"; tempstring = tempstring + "void volk_environment_init();\n"; - tempstring = tempstring + emit_epilog(); + tempstring = tempstring + "__VOLK_DECL_END\n"; tempstring = tempstring + "#endif\n" return tempstring; diff --git a/volk/gen/make_h.py b/volk/gen/make_h.py index 07e62939b..3d5790de4 100644 --- a/volk/gen/make_h.py +++ b/volk/gen/make_h.py @@ -1,16 +1,6 @@ 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 = ""; tempstring = tempstring + '/*this file is auto generated by make_h.py*/\n'; @@ -19,20 +9,26 @@ def make_h(funclist, arched_arglist) : tempstring = tempstring + '\n#define INCLUDED_VOLK_RUNTIME'; tempstring = tempstring + '\n\n#include<volk/volk_typedefs.h>\n'; tempstring = tempstring + '#include<volk/volk_config_fixed.h>\n'; - tempstring = tempstring + '#include<volk/volk_attributes.h>\n'; + tempstring = tempstring + '#include<volk/volk_common.h>\n'; tempstring = tempstring + '#include<volk/volk_complex.h>\n'; - tempstring = tempstring + volk_api_defines - tempstring = tempstring + emit_prolog(); + tempstring = tempstring + '__VOLK_DECL_BEGIN\n'; tempstring = tempstring + '\n'; + tempstring += """ +struct volk_func_desc { + const char **indices; + const int *arch_defs; + const int n_archs; +}; +""" for i in range(len(funclist)): tempstring += "extern " + replace_volk.sub("p", funclist[i]) + " " + funclist[i] + ";\n" tempstring += "extern VOLK_API void %s_manual%s;\n" % (funclist[i], arched_arglist[i]) tempstring = strip_trailing(tempstring, " {") tempstring += "extern VOLK_API struct volk_func_desc %s_get_func_desc(void);\n" % (funclist[i]) - tempstring = tempstring + emit_epilog(); + tempstring = tempstring + '__VOLK_DECL_END\n'; tempstring = tempstring + "#endif /*INCLUDED_VOLK_RUNTIME*/\n"; return tempstring; diff --git a/volk/gen/make_machines_h.py b/volk/gen/make_machines_h.py index aa6daa6cc..09ada3e0d 100644 --- a/volk/gen/make_machines_h.py +++ b/volk/gen/make_machines_h.py @@ -28,6 +28,8 @@ def make_machines_h(functions, machines, archs): #include <volk/volk_common.h> #include <volk/volk_typedefs.h> +__VOLK_DECL_BEGIN + struct volk_machine { const unsigned int caps; //capabilities (i.e., archs compiled into this machine, in the volk_get_lvarch format) const char *name; @@ -47,6 +49,9 @@ struct volk_machine { tempstring += """#endif\n""" tempstring += r""" + +__VOLK_DECL_END + #endif //INCLUDED_LIBVOLK_MACHINES_H""" return tempstring diff --git a/volk/gen/make_makefile_am.py b/volk/gen/make_makefile_am.py index 54017d2b3..ff9749e17 100644 --- a/volk/gen/make_makefile_am.py +++ b/volk/gen/make_makefile_am.py @@ -25,6 +25,7 @@ def make_makefile_am(dom, machines, archflags_dict): include $(top_srcdir)/Makefile.common AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) \ + -I$(top_srcdir)/include \ -I$(top_gendir)/include \ -Dvolk_EXPORTS \ -fvisibility=hidden \ @@ -43,7 +44,7 @@ EXTRA_DIST = \ libvolk_la_SOURCES = \ $(platform_CODE) \ - $(top_gendir)/lib/volk.cc \ + $(top_gendir)/lib/volk.c \ $(top_gendir)/lib/volk_cpu.c \ volk_rank_archs.c \ $(top_gendir)/lib/volk_machines.c diff --git a/volk/gen/volk_register.py b/volk/gen/volk_register.py index a239811db..dba364e01 100644 --- a/volk/gen/volk_register.py +++ b/volk/gen/volk_register.py @@ -36,7 +36,7 @@ for dir in ( outfile_set_simd = open(os.path.join(gendir, "config/lv_set_simd_flags.m4"), "w") outfile_h = open(os.path.join(gendir, "include/volk/volk.h"), "w") -outfile_c = open(os.path.join(gendir, "lib/volk.cc"), "w") +outfile_c = open(os.path.join(gendir, "lib/volk.c"), "w") outfile_typedefs = open(os.path.join(gendir, "include/volk/volk_typedefs.h"), "w") outfile_init_h = open(os.path.join(gendir, "lib/volk_init.h"), "w") outfile_cpu_h = open(os.path.join(gendir, "include/volk/volk_cpu.h"), "w") diff --git a/volk/include/volk/Makefile.am b/volk/include/volk/Makefile.am index bb4645526..a05f0fbfd 100644 --- a/volk/include/volk/Makefile.am +++ b/volk/include/volk/Makefile.am @@ -26,7 +26,6 @@ AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) \ volkincludedir = $(prefix)/include/volk volkinclude_HEADERS = \ - volk_attributes.h \ volk_complex.h \ volk_common.h \ $(top_gendir)/include/volk/volk_config_fixed.h \ diff --git a/volk/include/volk/volk_16ic_magnitude_16i_a16.h b/volk/include/volk/volk_16ic_magnitude_16i_a16.h index 00d29b112..73c6f3390 100644 --- a/volk/include/volk/volk_16ic_magnitude_16i_a16.h +++ b/volk/include/volk/volk_16ic_magnitude_16i_a16.h @@ -1,7 +1,7 @@ #ifndef INCLUDED_volk_16ic_magnitude_16i_a16_H #define INCLUDED_volk_16ic_magnitude_16i_a16_H -#include <volk/volk_attributes.h> +#include <volk/volk_common.h> #include <inttypes.h> #include <stdio.h> #include <math.h> diff --git a/volk/include/volk/volk_16ic_s32f_deinterleave_32f_x2_a16.h b/volk/include/volk/volk_16ic_s32f_deinterleave_32f_x2_a16.h index a4f0689e5..e4a9015b4 100644 --- a/volk/include/volk/volk_16ic_s32f_deinterleave_32f_x2_a16.h +++ b/volk/include/volk/volk_16ic_s32f_deinterleave_32f_x2_a16.h @@ -1,7 +1,7 @@ #ifndef INCLUDED_volk_16ic_s32f_deinterleave_32f_x2_a16_H #define INCLUDED_volk_16ic_s32f_deinterleave_32f_x2_a16_H -#include <volk/volk_attributes.h> +#include <volk/volk_common.h> #include <inttypes.h> #include <stdio.h> diff --git a/volk/include/volk/volk_16ic_s32f_deinterleave_real_32f_a16.h b/volk/include/volk/volk_16ic_s32f_deinterleave_real_32f_a16.h index 564aa1f5d..993445995 100644 --- a/volk/include/volk/volk_16ic_s32f_deinterleave_real_32f_a16.h +++ b/volk/include/volk/volk_16ic_s32f_deinterleave_real_32f_a16.h @@ -1,7 +1,7 @@ #ifndef INCLUDED_volk_16ic_s32f_deinterleave_real_32f_a16_H #define INCLUDED_volk_16ic_s32f_deinterleave_real_32f_a16_H -#include <volk/volk_attributes.h> +#include <volk/volk_common.h> #include <inttypes.h> #include <stdio.h> diff --git a/volk/include/volk/volk_16ic_s32f_magnitude_32f_a16.h b/volk/include/volk/volk_16ic_s32f_magnitude_32f_a16.h index 637ba9fd0..a136c0535 100644 --- a/volk/include/volk/volk_16ic_s32f_magnitude_32f_a16.h +++ b/volk/include/volk/volk_16ic_s32f_magnitude_32f_a16.h @@ -1,7 +1,7 @@ #ifndef INCLUDED_volk_16ic_s32f_magnitude_32f_a16_H #define INCLUDED_volk_16ic_s32f_magnitude_32f_a16_H -#include <volk/volk_attributes.h> +#include <volk/volk_common.h> #include <inttypes.h> #include <stdio.h> #include <math.h> diff --git a/volk/include/volk/volk_32f_accumulator_s32f_a16.h b/volk/include/volk/volk_32f_accumulator_s32f_a16.h index 94aff3a49..dd24a1e29 100644 --- a/volk/include/volk/volk_32f_accumulator_s32f_a16.h +++ b/volk/include/volk/volk_32f_accumulator_s32f_a16.h @@ -1,7 +1,7 @@ #ifndef INCLUDED_volk_32f_accumulator_s32f_a16_H #define INCLUDED_volk_32f_accumulator_s32f_a16_H -#include <volk/volk_attributes.h> +#include <volk/volk_common.h> #include <inttypes.h> #include <stdio.h> diff --git a/volk/include/volk/volk_32f_index_max_16u_a16.h b/volk/include/volk/volk_32f_index_max_16u_a16.h index 5c19bfca0..af1f35348 100644 --- a/volk/include/volk/volk_32f_index_max_16u_a16.h +++ b/volk/include/volk/volk_32f_index_max_16u_a16.h @@ -1,7 +1,7 @@ #ifndef INCLUDED_volk_32f_index_max_16u_a16_H #define INCLUDED_volk_32f_index_max_16u_a16_H -#include <volk/volk_attributes.h> +#include <volk/volk_common.h> #include <volk/volk_common.h> #include <inttypes.h> #include <stdio.h> diff --git a/volk/include/volk/volk_32f_s32f_calc_spectral_noise_floor_32f_a16.h b/volk/include/volk/volk_32f_s32f_calc_spectral_noise_floor_32f_a16.h index 70ab3ccdb..f5b388e6d 100644 --- a/volk/include/volk/volk_32f_s32f_calc_spectral_noise_floor_32f_a16.h +++ b/volk/include/volk/volk_32f_s32f_calc_spectral_noise_floor_32f_a16.h @@ -1,7 +1,7 @@ #ifndef INCLUDED_volk_32f_s32f_calc_spectral_noise_floor_32f_a16_H #define INCLUDED_volk_32f_s32f_calc_spectral_noise_floor_32f_a16_H -#include <volk/volk_attributes.h> +#include <volk/volk_common.h> #include <inttypes.h> #include <stdio.h> diff --git a/volk/include/volk/volk_32f_s32f_convert_16i_a16.h b/volk/include/volk/volk_32f_s32f_convert_16i_a16.h index 71b53ba3a..4acd2e13e 100644 --- a/volk/include/volk/volk_32f_s32f_convert_16i_a16.h +++ b/volk/include/volk/volk_32f_s32f_convert_16i_a16.h @@ -1,7 +1,7 @@ #ifndef INCLUDED_volk_32f_s32f_convert_16i_a16_H #define INCLUDED_volk_32f_s32f_convert_16i_a16_H -#include <volk/volk_attributes.h> +#include <volk/volk_common.h> #include <inttypes.h> #include <stdio.h> diff --git a/volk/include/volk/volk_32f_s32f_convert_32i_a16.h b/volk/include/volk/volk_32f_s32f_convert_32i_a16.h index 095d7bd35..2927d616c 100644 --- a/volk/include/volk/volk_32f_s32f_convert_32i_a16.h +++ b/volk/include/volk/volk_32f_s32f_convert_32i_a16.h @@ -1,7 +1,7 @@ #ifndef INCLUDED_volk_32f_s32f_convert_32i_a16_H #define INCLUDED_volk_32f_s32f_convert_32i_a16_H -#include <volk/volk_attributes.h> +#include <volk/volk_common.h> #include <inttypes.h> #include <stdio.h> diff --git a/volk/include/volk/volk_32f_s32f_convert_8i_a16.h b/volk/include/volk/volk_32f_s32f_convert_8i_a16.h index 509a46609..c114ea38f 100644 --- a/volk/include/volk/volk_32f_s32f_convert_8i_a16.h +++ b/volk/include/volk/volk_32f_s32f_convert_8i_a16.h @@ -1,7 +1,7 @@ #ifndef INCLUDED_volk_32f_s32f_convert_8i_a16_H #define INCLUDED_volk_32f_s32f_convert_8i_a16_H -#include <volk/volk_attributes.h> +#include <volk/volk_common.h> #include <inttypes.h> #include <stdio.h> diff --git a/volk/include/volk/volk_32f_s32f_stddev_32f_a16.h b/volk/include/volk/volk_32f_s32f_stddev_32f_a16.h index 779ae2d39..c2b903657 100644 --- a/volk/include/volk/volk_32f_s32f_stddev_32f_a16.h +++ b/volk/include/volk/volk_32f_s32f_stddev_32f_a16.h @@ -1,7 +1,7 @@ #ifndef INCLUDED_volk_32f_s32f_stddev_32f_a16_H #define INCLUDED_volk_32f_s32f_stddev_32f_a16_H -#include <volk/volk_attributes.h> +#include <volk/volk_common.h> #include <inttypes.h> #include <stdio.h> #include <math.h> diff --git a/volk/include/volk/volk_32f_stddev_and_mean_32f_x2_a16.h b/volk/include/volk/volk_32f_stddev_and_mean_32f_x2_a16.h index 9605322d3..10d72e09d 100644 --- a/volk/include/volk/volk_32f_stddev_and_mean_32f_x2_a16.h +++ b/volk/include/volk/volk_32f_stddev_and_mean_32f_x2_a16.h @@ -1,7 +1,7 @@ #ifndef INCLUDED_volk_32f_stddev_and_mean_32f_x2_a16_H #define INCLUDED_volk_32f_stddev_and_mean_32f_x2_a16_H -#include <volk/volk_attributes.h> +#include <volk/volk_common.h> #include <inttypes.h> #include <stdio.h> #include <math.h> diff --git a/volk/include/volk/volk_32f_x2_dot_prod_32f_a16.h b/volk/include/volk/volk_32f_x2_dot_prod_32f_a16.h index 93151260f..2cd974070 100644 --- a/volk/include/volk/volk_32f_x2_dot_prod_32f_a16.h +++ b/volk/include/volk/volk_32f_x2_dot_prod_32f_a16.h @@ -1,7 +1,7 @@ #ifndef INCLUDED_volk_32f_x2_dot_prod_32f_a16_H #define INCLUDED_volk_32f_x2_dot_prod_32f_a16_H -#include <volk/volk_attributes.h> +#include <volk/volk_common.h> #include<stdio.h> diff --git a/volk/include/volk/volk_32f_x2_s32f_interleave_16ic_a16.h b/volk/include/volk/volk_32f_x2_s32f_interleave_16ic_a16.h index cab3db50d..f7ad3fd18 100644 --- a/volk/include/volk/volk_32f_x2_s32f_interleave_16ic_a16.h +++ b/volk/include/volk/volk_32f_x2_s32f_interleave_16ic_a16.h @@ -1,7 +1,7 @@ #ifndef INCLUDED_volk_32f_x2_s32f_interleave_16ic_a16_H #define INCLUDED_volk_32f_x2_s32f_interleave_16ic_a16_H -#include <volk/volk_attributes.h> +#include <volk/volk_common.h> #include <inttypes.h> #include <stdio.h> diff --git a/volk/include/volk/volk_32fc_s32f_deinterleave_real_16i_a16.h b/volk/include/volk/volk_32fc_s32f_deinterleave_real_16i_a16.h index 304515a5c..2460039d2 100644 --- a/volk/include/volk/volk_32fc_s32f_deinterleave_real_16i_a16.h +++ b/volk/include/volk/volk_32fc_s32f_deinterleave_real_16i_a16.h @@ -1,7 +1,7 @@ #ifndef INCLUDED_volk_32fc_s32f_deinterleave_real_16i_a16_H #define INCLUDED_volk_32fc_s32f_deinterleave_real_16i_a16_H -#include <volk/volk_attributes.h> +#include <volk/volk_common.h> #include <inttypes.h> #include <stdio.h> diff --git a/volk/include/volk/volk_32fc_s32f_magnitude_16i_a16.h b/volk/include/volk/volk_32fc_s32f_magnitude_16i_a16.h index 96afa5ae9..f67ab0607 100644 --- a/volk/include/volk/volk_32fc_s32f_magnitude_16i_a16.h +++ b/volk/include/volk/volk_32fc_s32f_magnitude_16i_a16.h @@ -1,7 +1,7 @@ #ifndef INCLUDED_volk_32fc_s32f_magnitude_16i_a16_H #define INCLUDED_volk_32fc_s32f_magnitude_16i_a16_H -#include <volk/volk_attributes.h> +#include <volk/volk_common.h> #include <inttypes.h> #include <stdio.h> #include <math.h> diff --git a/volk/include/volk/volk_32fc_x2_conjugate_dot_prod_32fc_a16.h b/volk/include/volk/volk_32fc_x2_conjugate_dot_prod_32fc_a16.h index 78e28c903..f221237ff 100644 --- a/volk/include/volk/volk_32fc_x2_conjugate_dot_prod_32fc_a16.h +++ b/volk/include/volk/volk_32fc_x2_conjugate_dot_prod_32fc_a16.h @@ -1,7 +1,7 @@ #ifndef INCLUDED_volk_32fc_x2_conjugate_dot_prod_32fc_a16_H #define INCLUDED_volk_32fc_x2_conjugate_dot_prod_32fc_a16_H -#include <volk/volk_attributes.h> +#include <volk/volk_common.h> #include<volk/volk_complex.h> #include<stdio.h> diff --git a/volk/include/volk/volk_32fc_x2_dot_prod_32fc_a16.h b/volk/include/volk/volk_32fc_x2_dot_prod_32fc_a16.h index d404ee684..9657c8f6b 100644 --- a/volk/include/volk/volk_32fc_x2_dot_prod_32fc_a16.h +++ b/volk/include/volk/volk_32fc_x2_dot_prod_32fc_a16.h @@ -1,7 +1,7 @@ #ifndef INCLUDED_volk_32fc_x2_dot_prod_32fc_a16_H #define INCLUDED_volk_32fc_x2_dot_prod_32fc_a16_H -#include <volk/volk_attributes.h> +#include <volk/volk_common.h> #include <volk/volk_complex.h> #include <stdio.h> #include <string.h> diff --git a/volk/include/volk/volk_8ic_s32f_deinterleave_32f_x2_a16.h b/volk/include/volk/volk_8ic_s32f_deinterleave_32f_x2_a16.h index d68d2462a..7d778796e 100644 --- a/volk/include/volk/volk_8ic_s32f_deinterleave_32f_x2_a16.h +++ b/volk/include/volk/volk_8ic_s32f_deinterleave_32f_x2_a16.h @@ -1,7 +1,7 @@ #ifndef INCLUDED_volk_8ic_s32f_deinterleave_32f_x2_a16_H #define INCLUDED_volk_8ic_s32f_deinterleave_32f_x2_a16_H -#include <volk/volk_attributes.h> +#include <volk/volk_common.h> #include <inttypes.h> #include <stdio.h> diff --git a/volk/include/volk/volk_8ic_s32f_deinterleave_real_32f_a16.h b/volk/include/volk/volk_8ic_s32f_deinterleave_real_32f_a16.h index d2cfa42f6..a2e0cd8de 100644 --- a/volk/include/volk/volk_8ic_s32f_deinterleave_real_32f_a16.h +++ b/volk/include/volk/volk_8ic_s32f_deinterleave_real_32f_a16.h @@ -1,7 +1,7 @@ #ifndef INCLUDED_volk_8ic_s32f_deinterleave_real_32f_a16_H #define INCLUDED_volk_8ic_s32f_deinterleave_real_32f_a16_H -#include <volk/volk_attributes.h> +#include <volk/volk_common.h> #include <inttypes.h> #include <stdio.h> diff --git a/volk/include/volk/volk_attributes.h b/volk/include/volk/volk_attributes.h deleted file mode 100644 index 5345c1535..000000000 --- a/volk/include/volk/volk_attributes.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2011 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_VOLK_ATTRIBUTES_H -#define INCLUDED_VOLK_ATTRIBUTES_H - -//////////////////////////////////////////////////////////////////////// -// Cross-platform attribute macros -//////////////////////////////////////////////////////////////////////// -#if defined __GNUC__ -# define __VOLK_ATTR_ALIGNED(x) __attribute__((aligned(x))) -# define __VOLK_ATTR_UNUSED __attribute__((unused)) -# define __VOLK_ATTR_INLINE __attribute__((always_inline)) -# define __VOLK_ATTR_DEPRECATED __attribute__((deprecated)) -# if __GNUC__ >= 4 -# define __VOLK_ATTR_EXPORT __attribute__((visibility("default"))) -# define __VOLK_ATTR_IMPORT __attribute__((visibility("default"))) -# else -# define __VOLK_ATTR_EXPORT -# define __VOLK_ATTR_IMPORT -# endif -#elif _MSC_VER -# define __VOLK_ATTR_ALIGNED(x) __declspec(align(x)) -# define __VOLK_ATTR_UNUSED -# define __VOLK_ATTR_INLINE __forceinline -# define __VOLK_ATTR_DEPRECATED __declspec(deprecated) -# define __VOLK_ATTR_EXPORT __declspec(dllexport) -# define __VOLK_ATTR_IMPORT __declspec(dllimport) -#else -# define __VOLK_ATTR_ALIGNED(x) -# define __VOLK_ATTR_UNUSED -# define __VOLK_ATTR_INLINE -# define __VOLK_ATTR_DEPRECATED -# define __VOLK_ATTR_EXPORT -# define __VOLK_ATTR_IMPORT -#endif - -#endif /* INCLUDED_VOLK_ATTRIBUTES_H */ diff --git a/volk/include/volk/volk_common.h b/volk/include/volk/volk_common.h index 0a47ff864..1e868561e 100644 --- a/volk/include/volk/volk_common.h +++ b/volk/include/volk/volk_common.h @@ -1,6 +1,62 @@ #ifndef INCLUDED_LIBVOLK_COMMON_H #define INCLUDED_LIBVOLK_COMMON_H +//////////////////////////////////////////////////////////////////////// +// Cross-platform attribute macros +//////////////////////////////////////////////////////////////////////// +#if defined __GNUC__ +# define __VOLK_ATTR_ALIGNED(x) __attribute__((aligned(x))) +# define __VOLK_ATTR_UNUSED __attribute__((unused)) +# define __VOLK_ATTR_INLINE __attribute__((always_inline)) +# define __VOLK_ATTR_DEPRECATED __attribute__((deprecated)) +# if __GNUC__ >= 4 +# define __VOLK_ATTR_EXPORT __attribute__((visibility("default"))) +# define __VOLK_ATTR_IMPORT __attribute__((visibility("default"))) +# else +# define __VOLK_ATTR_EXPORT +# define __VOLK_ATTR_IMPORT +# endif +#elif _MSC_VER +# define __VOLK_ATTR_ALIGNED(x) __declspec(align(x)) +# define __VOLK_ATTR_UNUSED +# define __VOLK_ATTR_INLINE __forceinline +# define __VOLK_ATTR_DEPRECATED __declspec(deprecated) +# define __VOLK_ATTR_EXPORT __declspec(dllexport) +# define __VOLK_ATTR_IMPORT __declspec(dllimport) +#else +# define __VOLK_ATTR_ALIGNED(x) +# define __VOLK_ATTR_UNUSED +# define __VOLK_ATTR_INLINE +# define __VOLK_ATTR_DEPRECATED +# define __VOLK_ATTR_EXPORT +# define __VOLK_ATTR_IMPORT +#endif + +//////////////////////////////////////////////////////////////////////// +// C-linkage declaration macros +// FIXME: due to the usage of complex.h, require gcc for c-linkage +//////////////////////////////////////////////////////////////////////// +#if defined(__cplusplus) && (__GNUC__) +# define __VOLK_DECL_BEGIN extern "C" { +# define __VOLK_DECL_END } +#else +# define __VOLK_DECL_BEGIN +# define __VOLK_DECL_END +#endif + +//////////////////////////////////////////////////////////////////////// +// Define VOLK_API for library symbols +// http://gcc.gnu.org/wiki/Visibility +//////////////////////////////////////////////////////////////////////// +#ifdef volk_EXPORTS +# define VOLK_API __VOLK_ATTR_EXPORT +#else +# define VOLK_API __VOLK_ATTR_IMPORT +#endif + +//////////////////////////////////////////////////////////////////////// +// The bit128 union used by some +//////////////////////////////////////////////////////////////////////// #include<inttypes.h> #ifdef LV_HAVE_MMX #include<xmmintrin.h> @@ -15,10 +71,4 @@ union bit128{ }; #endif /*LV_HAVE_MMX*/ -struct volk_func_desc { - const char **indices; - const int *arch_defs; - const int n_archs; -}; - #endif /*INCLUDED_LIBVOLK_COMMON_H*/ |