summaryrefslogtreecommitdiff
path: root/volk/include
diff options
context:
space:
mode:
authorJosh Blum2011-04-17 17:39:15 -0700
committerJosh Blum2011-04-17 17:39:15 -0700
commita56b291edf063604ea40391f40771eda99d8eb40 (patch)
tree8f5dbd6017ded0e1388af1f14c241924f2979dd7 /volk/include
parent208dcc510e6b6beedf2479a598a90d32c19e1274 (diff)
downloadgnuradio-a56b291edf063604ea40391f40771eda99d8eb40.tar.gz
gnuradio-a56b291edf063604ea40391f40771eda99d8eb40.tar.bz2
gnuradio-a56b291edf063604ea40391f40771eda99d8eb40.zip
volk: added attributes header (copied from gruel)
Diffstat (limited to 'volk/include')
-rw-r--r--volk/include/volk/Makefile.am1
-rw-r--r--volk/include/volk/make_h.py1
-rw-r--r--volk/include/volk/volk_attributes.h56
3 files changed, 58 insertions, 0 deletions
diff --git a/volk/include/volk/Makefile.am b/volk/include/volk/Makefile.am
index 9a665f59e..a4440a980 100644
--- a/volk/include/volk/Makefile.am
+++ b/volk/include/volk/Makefile.am
@@ -26,6 +26,7 @@ AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(CPPUNIT_CPPFLAGS) \
volkincludedir = $(prefix)/include/volk
volkinclude_HEADERS = \
+ volk_attributes.h \
volk_complex.h \
volk_common.h \
volk_config_fixed.h \
diff --git a/volk/include/volk/make_h.py b/volk/include/volk/make_h.py
index bf449719d..81928e6b5 100644
--- a/volk/include/volk/make_h.py
+++ b/volk/include/volk/make_h.py
@@ -12,6 +12,7 @@ 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_complex.h>\n';
tempstring = tempstring + emit_prolog();
diff --git a/volk/include/volk/volk_attributes.h b/volk/include/volk/volk_attributes.h
new file mode 100644
index 000000000..5345c1535
--- /dev/null
+++ b/volk/include/volk/volk_attributes.h
@@ -0,0 +1,56 @@
+/*
+ * 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 */