summaryrefslogtreecommitdiff
path: root/gnuradio-runtime/include/gnuradio/attributes.h
diff options
context:
space:
mode:
authorJohnathan Corgan <johnathan@corganlabs.com>2016-05-30 14:08:07 -0700
committerJohnathan Corgan <johnathan@corganlabs.com>2016-05-30 14:08:07 -0700
commitc034036fbb0a097b2ccbbacdfdb113f8355cdbcc (patch)
tree12366caf390de89db7e7e32646b08854c8f01bc5 /gnuradio-runtime/include/gnuradio/attributes.h
parent11ce2621937e6fa1d5440c8f485c7a27b9d34d27 (diff)
parentc5f7b07aff9320e3d13bb8d26aa4dc43093e569a (diff)
Merge branch 'next' into 'next-qt5'
Diffstat (limited to 'gnuradio-runtime/include/gnuradio/attributes.h')
-rw-r--r--gnuradio-runtime/include/gnuradio/attributes.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/gnuradio-runtime/include/gnuradio/attributes.h b/gnuradio-runtime/include/gnuradio/attributes.h
index 3d2e764cd5..0102c110c2 100644
--- a/gnuradio-runtime/include/gnuradio/attributes.h
+++ b/gnuradio-runtime/include/gnuradio/attributes.h
@@ -78,4 +78,15 @@
# pragma warning(disable: 4290) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
#endif
+////////////////////////////////////////////////////////////////////////
+// implement cross-compiler VLA macros
+////////////////////////////////////////////////////////////////////////
+#ifdef C99
+# define __GR_VLA(TYPE, buf, size) TYPE buf[size]
+# define __GR_VLA2D(TYPE, buf, size, size2) TYPE buf[size][size2]
+#else
+# define __GR_VLA(TYPE, buf, size) TYPE * buf = (TYPE *) alloca(sizeof(TYPE) * (size))
+# define __GR_VLA2D(TYPE, buf, size, size2) TYPE ** buf = (TYPE **) alloca(sizeof(TYPE) * (size) * (size2))
+#endif
+
#endif /* INCLUDED_GNURADIO_ATTRIBUTES_H */