diff options
author | gnieboer <gnieboer@corpcomm.net> | 2016-05-22 10:38:19 +0300 |
---|---|---|
committer | Johnathan Corgan <johnathan@corganlabs.com> | 2016-05-30 13:25:54 -0700 |
commit | 23460e36094ad85c559a538918c3b40e76b2fa37 (patch) | |
tree | de433fef9de1f71f80718b0ca81d87e9684de659 /gnuradio-runtime/include/gnuradio/attributes.h | |
parent | 25142dad0464bed59dc03672931aab637f82d376 (diff) |
MSVC-specific fixes for compatibility
* Changed dtv_viterbi_decoder to use __GR_ATTR_ALIGNED macro for
cross-compiler compatibility
* Replace usleep() with boost equivalent for cross-compiler
compatibility
* Includes windows-specific headers for portaudio
* Added macro to handle use of VLAs on non-C99 compilers (MSVC) using
alloca to declare variable length arrays
* Remove setting SO_LINGER option for the UDP source. SO_LINGER is
not an applicable option for a UDP socket. Windows will throw an
exception if set. Linux allows it to be set but does not use it.
* VS 2013+ supports round()
Diffstat (limited to 'gnuradio-runtime/include/gnuradio/attributes.h')
-rw-r--r-- | gnuradio-runtime/include/gnuradio/attributes.h | 11 |
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 */ |