summaryrefslogtreecommitdiff
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
parent11ce2621937e6fa1d5440c8f485c7a27b9d34d27 (diff)
parentc5f7b07aff9320e3d13bb8d26aa4dc43093e569a (diff)
Merge branch 'next' into 'next-qt5'
-rw-r--r--CMakeLists.txt15
-rw-r--r--cmake/Modules/FindGSL.cmake2
-rw-r--r--cmake/Modules/FindQwt.cmake4
-rw-r--r--cmake/Modules/GrBoost.cmake7
-rw-r--r--cmake/msvc/config.h7
-rw-r--r--gnuradio-runtime/include/gnuradio/attributes.h11
-rw-r--r--gnuradio-runtime/include/gnuradio/high_res_timer.h2
-rw-r--r--gnuradio-runtime/lib/CMakeLists.txt8
-rw-r--r--gnuradio-runtime/lib/flat_flowgraph.cc4
-rw-r--r--gnuradio-runtime/lib/math/random.cc2
-rw-r--r--gnuradio-runtime/lib/realtime_impl.cc70
-rw-r--r--gnuradio-runtime/lib/thread/thread.cc10
-rw-r--r--gnuradio-runtime/lib/thread/thread_body_wrapper.cc2
-rw-r--r--gnuradio-runtime/lib/tpb_thread_body.cc4
-rw-r--r--gr-audio/lib/portaudio/portaudio_sink.cc3
-rw-r--r--gr-audio/lib/portaudio/portaudio_source.cc3
-rw-r--r--gr-blocks/lib/ConfigChecks.cmake2
-rw-r--r--gr-blocks/lib/udp_source_impl.cc3
-rw-r--r--gr-dtv/lib/CMakeLists.txt19
-rw-r--r--gr-dtv/lib/dvbt/dvbt_bit_inner_deinterleaver_impl.cc5
-rw-r--r--gr-dtv/lib/dvbt/dvbt_bit_inner_interleaver_impl.cc3
-rw-r--r--gr-dtv/lib/dvbt/dvbt_ofdm_sym_acquisition_impl.cc4
-rw-r--r--gr-dtv/lib/dvbt/dvbt_reed_solomon.cc14
-rw-r--r--gr-dtv/lib/dvbt/dvbt_viterbi_decoder_impl.cc24
-rw-r--r--gr-qtgui/lib/CMakeLists.txt5
-rw-r--r--gr-vocoder/lib/codec2/fdmdv.c2
-rw-r--r--gr-zeromq/lib/pull_msg_source_impl.cc4
-rw-r--r--gr-zeromq/lib/req_msg_source_impl.cc4
-rw-r--r--gr-zeromq/lib/sub_msg_source_impl.cc4
29 files changed, 158 insertions, 89 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4c7012f05c..47b9814035 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -50,9 +50,11 @@ set(VERSION_INFO_MINOR_VERSION git)
set(VERSION_INFO_MAINT_VERSION 0)
include(GrVersion) #setup version info
-# Append -O2 optimization flag for Debug builds
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O2")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O2")
+# Append -O2 optimization flag for Debug builds (Not on MSVC since conflicts with RTC1 flag)
+IF (NOT MSVC)
+ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O2")
+ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O2")
+ENDIF()
# Set C/C++ standard for all targets
# NOTE: Starting with cmake v3.1 this should be used:
@@ -83,7 +85,7 @@ ENDIF()
# Environment setup
########################################################################
IF(NOT DEFINED BOOST_ROOT)
- SET(BOOST_ROOT ${CMAKE_INSTALL_PREFIX})
+ SET(BOOST_ROOT "${CMAKE_INSTALL_PREFIX}")
ENDIF()
########################################################################
@@ -145,6 +147,9 @@ IF(MSVC)
ELSE(MSVC12) #Visual Studio 12
SET(cmake_c_compiler_version "Microsoft Visual Studio 12.0")
SET(cmake_cxx_compiler_version "Microsoft Visual Studio 12.0")
+ ELSE(MSVC14) #Visual Studio 14
+ SET(cmake_c_compiler_version "Microsoft Visual Studio 14.0")
+ SET(cmake_cxx_compiler_version "Microsoft Visual Studio 14.0")
ENDIF()
ELSE()
execute_process(COMMAND ${CMAKE_C_COMPILER} --version
@@ -183,7 +188,7 @@ set(GR_THEMES_DIR ${GR_PKG_DATA_DIR}/themes CACHE PATH "Path to install QTG
# Set location of config/prefs files in /etc
# Special exception if prefix is /usr so we don't make a /usr/etc.
set(GR_CONF_DIR etc CACHE PATH "Path to install config files")
-string(COMPARE EQUAL ${CMAKE_INSTALL_PREFIX} "/usr" isusr)
+string(COMPARE EQUAL "${CMAKE_INSTALL_PREFIX}" "/usr" isusr)
if(isusr)
set(SYSCONFDIR "/${GR_CONF_DIR}" CACHE PATH "System configuration directory")
else(isusr)
diff --git a/cmake/Modules/FindGSL.cmake b/cmake/Modules/FindGSL.cmake
index b36a1e9c2a..7b8c6cdb64 100644
--- a/cmake/Modules/FindGSL.cmake
+++ b/cmake/Modules/FindGSL.cmake
@@ -44,7 +44,7 @@ if( WIN32 AND NOT CYGWIN AND NOT MSYS )
# look for gsl cblas library
find_library( GSL_CBLAS_LIBRARY
- NAMES gslcblas
+ NAMES gslcblas cblas
)
if( GSL_CBLAS_LIBRARY )
set( GSL_CBLAS_FOUND ON )
diff --git a/cmake/Modules/FindQwt.cmake b/cmake/Modules/FindQwt.cmake
index 95ddd4454b..547a49f0ec 100644
--- a/cmake/Modules/FindQwt.cmake
+++ b/cmake/Modules/FindQwt.cmake
@@ -9,6 +9,7 @@ find_path(QWT_INCLUDE_DIRS
NAMES qwt_global.h
HINTS
${CMAKE_INSTALL_PREFIX}/include/qwt
+ ${CMAKE_PREFIX_PATH}/include/qwt
PATHS
/usr/local/include/qwt-qt5
/usr/local/include/qwt
@@ -22,10 +23,11 @@ find_path(QWT_INCLUDE_DIRS
)
find_library (QWT_LIBRARIES
- NAMES qwt6 qwt6-qt5 qwt qwt-qt5
+ NAMES qwt6 qwt6-qt4 qwt qwt-qt4 qwt5 qwtd5
HINTS
${CMAKE_INSTALL_PREFIX}/lib
${CMAKE_INSTALL_PREFIX}/lib64
+ ${CMAKE_PREFIX_PATH}/lib
PATHS
/usr/local/lib
/usr/lib
diff --git a/cmake/Modules/GrBoost.cmake b/cmake/Modules/GrBoost.cmake
index ecf58a9367..6e036a5bdc 100644
--- a/cmake/Modules/GrBoost.cmake
+++ b/cmake/Modules/GrBoost.cmake
@@ -31,10 +31,15 @@ set(BOOST_REQUIRED_COMPONENTS
program_options
filesystem
system
- thread
regex
)
+if (MINGW)
+ set(BOOST_REQUIRED_COMPONENTS ${BOOST_REQUIRED_COMPONENTS} thread_win32)
+else(MINGW)
+ set(BOOST_REQUIRED_COMPONENTS ${BOOST_REQUIRED_COMPONENTS} thread)
+endif(MINGW)
+
if(UNIX AND NOT BOOST_ROOT AND EXISTS "/usr/lib64")
list(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix
endif(UNIX AND NOT BOOST_ROOT AND EXISTS "/usr/lib64")
diff --git a/cmake/msvc/config.h b/cmake/msvc/config.h
index 43792c7837..50515104db 100644
--- a/cmake/msvc/config.h
+++ b/cmake/msvc/config.h
@@ -21,19 +21,25 @@ typedef ptrdiff_t ssize_t;
////////////////////////////////////////////////////////////////////////
// rint functions
////////////////////////////////////////////////////////////////////////
+#define _USE_MATH_DEFINES
#include <math.h>
+#if _MSC_VER < 1800
static inline long lrint(double x){return (long)(x > 0.0 ? x + 0.5 : x - 0.5);}
static inline long lrintf(float x){return (long)(x > 0.0f ? x + 0.5f : x - 0.5f);}
static inline long long llrint(double x){return (long long)(x > 0.0 ? x + 0.5 : x - 0.5);}
static inline long long llrintf(float x){return (long long)(x > 0.0f ? x + 0.5f : x - 0.5f);}
static inline double rint(double x){return (x > 0.0)? floor(x + 0.5) : ceil(x - 0.5);}
static inline float rintf(float x){return (x > 0.0f)? floorf(x + 0.5f) : ceilf(x - 0.5f);}
+#endif
////////////////////////////////////////////////////////////////////////
// math constants
////////////////////////////////////////////////////////////////////////
+#ifndef INFINITY
#define INFINITY HUGE_VAL
+#endif
+#ifndef _MATH_DEFINES_DEFINED
# define M_E 2.7182818284590452354 /* e */
# define M_LOG2E 1.4426950408889634074 /* log_2 e */
# define M_LOG10E 0.43429448190325182765 /* log_10 e */
@@ -47,6 +53,7 @@ static inline float rintf(float x){return (x > 0.0f)? floorf(x + 0.5f) : ceilf(x
# define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */
# define M_SQRT2 1.41421356237309504880 /* sqrt(2) */
# define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
+#endif
////////////////////////////////////////////////////////////////////////
// random and srandom
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 */
diff --git a/gnuradio-runtime/include/gnuradio/high_res_timer.h b/gnuradio-runtime/include/gnuradio/high_res_timer.h
index ce11cd8ebb..5f6a285a11 100644
--- a/gnuradio-runtime/include/gnuradio/high_res_timer.h
+++ b/gnuradio-runtime/include/gnuradio/high_res_timer.h
@@ -107,7 +107,7 @@ namespace gr {
////////////////////////////////////////////////////////////////////////
#ifdef GNURADIO_HRT_USE_QUERY_PERFORMANCE_COUNTER
- #include <Windows.h>
+ #include <windows.h>
inline gr::high_res_timer_type gr::high_res_timer_now(void){
LARGE_INTEGER counts;
diff --git a/gnuradio-runtime/lib/CMakeLists.txt b/gnuradio-runtime/lib/CMakeLists.txt
index cc51f97855..3da550d37b 100644
--- a/gnuradio-runtime/lib/CMakeLists.txt
+++ b/gnuradio-runtime/lib/CMakeLists.txt
@@ -31,9 +31,9 @@ message(STATUS "Loading build date ${BUILD_DATE} into constants...")
message(STATUS "Loading version ${VERSION} into constants...")
#double escape for windows backslash path separators
-string(REPLACE "\\" "\\\\" prefix ${prefix})
-string(REPLACE "\\" "\\\\" SYSCONFDIR ${SYSCONFDIR})
-string(REPLACE "\\" "\\\\" GR_PREFSDIR ${GR_PREFSDIR})
+string(REPLACE "\\" "\\\\" prefix "${prefix}")
+string(REPLACE "\\" "\\\\" SYSCONFDIR "${SYSCONFDIR}")
+string(REPLACE "\\" "\\\\" GR_PREFSDIR "${GR_PREFSDIR}")
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/constants.cc.in
@@ -149,7 +149,7 @@ CHECK_INCLUDE_FILE_CXX(windows.h HAVE_WINDOWS_H)
IF(HAVE_WINDOWS_H)
ADD_DEFINITIONS(-DHAVE_WINDOWS_H -DUSING_WINSOCK -DWIN32_LEAN_AND_MEAN)
MESSAGE(STATUS "Adding windows libs to gnuradio runtime libs...")
- LIST(APPEND gnuradio_runtime_libs WS2_32.lib WSock32.lib)
+ LIST(APPEND gnuradio_runtime_libs ws2_32 wsock32)
ENDIF(HAVE_WINDOWS_H)
#need to link with librt on ubuntu 11.10 for shm_*
diff --git a/gnuradio-runtime/lib/flat_flowgraph.cc b/gnuradio-runtime/lib/flat_flowgraph.cc
index 03e67eb2c2..434a92fb3d 100644
--- a/gnuradio-runtime/lib/flat_flowgraph.cc
+++ b/gnuradio-runtime/lib/flat_flowgraph.cc
@@ -331,7 +331,7 @@ namespace gr {
const int alignment = volk_get_alignment();
for(int i = 0; i < block->detail()->ninputs(); i++) {
void *r = (void*)block->detail()->input(i)->read_pointer();
- unsigned long int ri = (unsigned long int)r % alignment;
+ uintptr_t ri = (uintptr_t)r % alignment;
//std::cerr << "reader: " << r << " alignment: " << ri << std::endl;
if(ri != 0) {
size_t itemsize = block->detail()->input(i)->get_sizeof_item();
@@ -343,7 +343,7 @@ namespace gr {
for(int i = 0; i < block->detail()->noutputs(); i++) {
void *w = (void*)block->detail()->output(i)->write_pointer();
- unsigned long int wi = (unsigned long int)w % alignment;
+ uintptr_t wi = (uintptr_t)w % alignment;
//std::cerr << "writer: " << w << " alignment: " << wi << std::endl;
if(wi != 0) {
size_t itemsize = block->detail()->output(i)->get_sizeof_item();
diff --git a/gnuradio-runtime/lib/math/random.cc b/gnuradio-runtime/lib/math/random.cc
index 5e16c96ea4..35f63076b2 100644
--- a/gnuradio-runtime/lib/math/random.cc
+++ b/gnuradio-runtime/lib/math/random.cc
@@ -127,7 +127,7 @@ namespace gr {
x = 2.0*ran1()-1.0;
y = 2.0*ran1()-1.0;
s = x*x+y*y;
- }while(not(s<1.0));
+ }while(s >= 1.0f || s == 0.0f);
d_gauss_stored = true;
d_gauss_value = x*sqrt(-2.0*log(s)/s);
return y*sqrt(-2.0*log(s)/s);
diff --git a/gnuradio-runtime/lib/realtime_impl.cc b/gnuradio-runtime/lib/realtime_impl.cc
index 54db9d8d70..83afd9568d 100644
--- a/gnuradio-runtime/lib/realtime_impl.cc
+++ b/gnuradio-runtime/lib/realtime_impl.cc
@@ -65,7 +65,41 @@ namespace gr {
#endif
-#if defined(HAVE_PTHREAD_SETSCHEDPARAM)
+#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
+
+#include <windows.h>
+
+namespace gr {
+ namespace impl {
+
+ rt_status_t enable_realtime_scheduling(rt_sched_param p)
+ {
+ //set the priority class on the process
+ int pri_class = (true)? REALTIME_PRIORITY_CLASS : NORMAL_PRIORITY_CLASS;
+ if(SetPriorityClass(GetCurrentProcess(), pri_class) == 0)
+ return RT_OTHER_ERROR;
+
+ //scale the priority value to the constants
+ int priorities[] = {
+ THREAD_PRIORITY_IDLE, THREAD_PRIORITY_LOWEST, THREAD_PRIORITY_BELOW_NORMAL, THREAD_PRIORITY_NORMAL,
+ THREAD_PRIORITY_ABOVE_NORMAL, THREAD_PRIORITY_HIGHEST, THREAD_PRIORITY_TIME_CRITICAL
+ };
+ const double priority = double(p.priority)/(rt_priority_max() - rt_priority_min());
+ size_t pri_index = size_t((priority+1.0)*6/2.0); // -1 -> 0, +1 -> 6
+ pri_index %= sizeof(priorities)/sizeof(*priorities); //range check
+
+ //set the thread priority on the thread
+ if(SetThreadPriority(GetCurrentThread(), priorities[pri_index]) == 0)
+ return RT_OTHER_ERROR;
+
+ //printf("SetPriorityClass + SetThreadPriority\n");
+ return RT_OK;
+ }
+
+ } // namespace impl
+} // namespace gr
+
+#elif defined(HAVE_PTHREAD_SETSCHEDPARAM)
namespace gr {
namespace impl {
@@ -141,40 +175,6 @@ namespace gr {
} // namespace impl
} // namespace gr
-#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
-
-#include <windows.h>
-
-namespace gr {
- namespace impl {
-
- rt_status_t enable_realtime_scheduling(rt_sched_param p)
- {
- //set the priority class on the process
- int pri_class = (true)? REALTIME_PRIORITY_CLASS : NORMAL_PRIORITY_CLASS;
- if(SetPriorityClass(GetCurrentProcess(), pri_class) == 0)
- return RT_OTHER_ERROR;
-
- //scale the priority value to the constants
- int priorities[] = {
- THREAD_PRIORITY_IDLE, THREAD_PRIORITY_LOWEST, THREAD_PRIORITY_BELOW_NORMAL, THREAD_PRIORITY_NORMAL,
- THREAD_PRIORITY_ABOVE_NORMAL, THREAD_PRIORITY_HIGHEST, THREAD_PRIORITY_TIME_CRITICAL
- };
- const double priority = double(p.priority)/(rt_priority_max() - rt_priority_min());
- size_t pri_index = size_t((priority+1.0)*6/2.0); // -1 -> 0, +1 -> 6
- pri_index %= sizeof(priorities)/sizeof(*priorities); //range check
-
- //set the thread priority on the thread
- if(SetThreadPriority(GetCurrentThread(), priorities[pri_index]) == 0)
- return RT_OTHER_ERROR;
-
- //printf("SetPriorityClass + SetThreadPriority\n");
- return RT_OK;
- }
-
- } // namespace impl
-} // namespace gr
-
#else
namespace gr {
diff --git a/gnuradio-runtime/lib/thread/thread.cc b/gnuradio-runtime/lib/thread/thread.cc
index 483dfed493..f2606c71ae 100644
--- a/gnuradio-runtime/lib/thread/thread.cc
+++ b/gnuradio-runtime/lib/thread/thread.cc
@@ -28,7 +28,7 @@
#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
-#include <Windows.h>
+#include <windows.h>
namespace gr {
namespace thread {
@@ -111,6 +111,7 @@ namespace gr {
// Not implemented on Windows
return -1;
}
+#ifndef __MINGW32__
#pragma pack(push,8)
typedef struct tagTHREADNAME_INFO
{
@@ -152,6 +153,13 @@ namespace gr {
_set_thread_name(thread, name.c_str(), dwThreadId);
}
+#else
+ void
+ set_thread_name(gr_thread_t thread, std::string name)
+ {
+ /* Not implemented on mingw-w64 */
+ }
+#endif /* !__MINGW32__ */
} /* namespace thread */
} /* namespace gr */
diff --git a/gnuradio-runtime/lib/thread/thread_body_wrapper.cc b/gnuradio-runtime/lib/thread/thread_body_wrapper.cc
index e23b7d15d0..fffa7e4c44 100644
--- a/gnuradio-runtime/lib/thread/thread_body_wrapper.cc
+++ b/gnuradio-runtime/lib/thread/thread_body_wrapper.cc
@@ -34,7 +34,7 @@
namespace gr {
namespace thread {
-#if defined(HAVE_PTHREAD_SIGMASK) && defined(HAVE_SIGNAL_H)
+#if defined(HAVE_PTHREAD_SIGMASK) && defined(HAVE_SIGNAL_H) && !defined(__MINGW32__)
void mask_signals()
{
diff --git a/gnuradio-runtime/lib/tpb_thread_body.cc b/gnuradio-runtime/lib/tpb_thread_body.cc
index e0aacb4153..e3f57eef53 100644
--- a/gnuradio-runtime/lib/tpb_thread_body.cc
+++ b/gnuradio-runtime/lib/tpb_thread_body.cc
@@ -37,8 +37,8 @@ namespace gr {
{
//std::cerr << "tpb_thread_body: " << block << std::endl;
-#ifdef _MSC_VER
- #include <Windows.h>
+#if defined(_MSC_VER) || defined(__MINGW32__)
+ #include <windows.h>
thread::set_thread_name(GetCurrentThread(), boost::str(boost::format("%s%d") % block->name() % block->unique_id()));
#else
thread::set_thread_name(pthread_self(), boost::str(boost::format("%s%d") % block->name() % block->unique_id()));
diff --git a/gr-audio/lib/portaudio/portaudio_sink.cc b/gr-audio/lib/portaudio/portaudio_sink.cc
index 4a0a969895..2397b65442 100644
--- a/gr-audio/lib/portaudio/portaudio_sink.cc
+++ b/gr-audio/lib/portaudio/portaudio_sink.cc
@@ -34,6 +34,9 @@
#include <unistd.h>
#include <stdexcept>
#include <string.h>
+#ifdef _MSC_VER
+#include <io.h>
+#endif
namespace gr {
namespace audio {
diff --git a/gr-audio/lib/portaudio/portaudio_source.cc b/gr-audio/lib/portaudio/portaudio_source.cc
index efbe2b6fc7..1e1bbfacbb 100644
--- a/gr-audio/lib/portaudio/portaudio_source.cc
+++ b/gr-audio/lib/portaudio/portaudio_source.cc
@@ -34,6 +34,9 @@
#include <unistd.h>
#include <stdexcept>
#include <string.h>
+#ifdef _MSC_VER
+#include <io.h>
+#endif
namespace gr {
namespace audio {
diff --git a/gr-blocks/lib/ConfigChecks.cmake b/gr-blocks/lib/ConfigChecks.cmake
index 7f60aed403..1effaa8360 100644
--- a/gr-blocks/lib/ConfigChecks.cmake
+++ b/gr-blocks/lib/ConfigChecks.cmake
@@ -56,7 +56,7 @@ CHECK_INCLUDE_FILE_CXX(windows.h HAVE_WINDOWS_H)
IF(HAVE_WINDOWS_H)
ADD_DEFINITIONS(-DHAVE_WINDOWS_H -DUSING_WINSOCK)
MESSAGE(STATUS "Adding windows libs to gr blocks libs...")
- LIST(APPEND blocks_libs WS2_32.lib WSock32.lib)
+ LIST(APPEND blocks_libs ws2_32 wsock32)
ENDIF(HAVE_WINDOWS_H)
########################################################################
diff --git a/gr-blocks/lib/udp_source_impl.cc b/gr-blocks/lib/udp_source_impl.cc
index d1d3b45827..ea2f2b60a0 100644
--- a/gr-blocks/lib/udp_source_impl.cc
+++ b/gr-blocks/lib/udp_source_impl.cc
@@ -95,9 +95,6 @@ namespace gr {
d_socket = new boost::asio::ip::udp::socket(d_io_service);
d_socket->open(d_endpoint.protocol());
- boost::asio::socket_base::linger loption(true, 0);
- d_socket->set_option(loption);
-
boost::asio::socket_base::reuse_address roption(true);
d_socket->set_option(roption);
diff --git a/gr-dtv/lib/CMakeLists.txt b/gr-dtv/lib/CMakeLists.txt
index 6ae308395d..fec48990a2 100644
--- a/gr-dtv/lib/CMakeLists.txt
+++ b/gr-dtv/lib/CMakeLists.txt
@@ -133,10 +133,25 @@ list(APPEND dtv_libs
)
include (CheckCCompilerFlag)
-CHECK_C_COMPILER_FLAG ("-msse2" SSE2_SUPPORTED)
+if (MSVC)
+ # 64-bit MSVC always supports SSE2
+ if (CMAKE_SIZEOF_VOID_P EQUAL 8)
+ set(SSE2_SUPPORTED true)
+ else ()
+ CHECK_C_COMPILER_FLAG ("/arch:SSE2" SSE2_SUPPORTED)
+ endif(CMAKE_SIZEOF_VOID_P EQUAL 8)
+else ()
+ CHECK_C_COMPILER_FLAG ("-msse2" SSE2_SUPPORTED)
+endif(MSVC)
if(SSE2_SUPPORTED)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2")
+ if (NOT MSVC)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2")
+ else ()
+ if (CMAKE_SIZEOF_VOID_P EQUAL 4)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:SSE2")
+ endif ()
+ endif ()
ADD_DEFINITIONS(-DDTV_SSE2)
endif(SSE2_SUPPORTED)
diff --git a/gr-dtv/lib/dvbt/dvbt_bit_inner_deinterleaver_impl.cc b/gr-dtv/lib/dvbt/dvbt_bit_inner_deinterleaver_impl.cc
index bf7613adae..9e45c81018 100644
--- a/gr-dtv/lib/dvbt/dvbt_bit_inner_deinterleaver_impl.cc
+++ b/gr-dtv/lib/dvbt/dvbt_bit_inner_deinterleaver_impl.cc
@@ -135,8 +135,9 @@ namespace gr {
// First index of d_b is Bit interleaver number
// Second index of d_b is the position inside Bit interleaver
- unsigned char d_b[d_v][d_bsize];
-
+ // Linux: unsigned char d_b[d_v][d_bsize];
+ __GR_VLA2D(unsigned char, d_b, d_v, d_bsize);
+
for (int bcount = 0; bcount < bmax; bcount++) {
for (int w = 0; w < d_bsize; w++) {
int c = in[(bcount * d_bsize) + w];
diff --git a/gr-dtv/lib/dvbt/dvbt_bit_inner_interleaver_impl.cc b/gr-dtv/lib/dvbt/dvbt_bit_inner_interleaver_impl.cc
index 0ab3003d50..d2bfb3d9d2 100644
--- a/gr-dtv/lib/dvbt/dvbt_bit_inner_interleaver_impl.cc
+++ b/gr-dtv/lib/dvbt/dvbt_bit_inner_interleaver_impl.cc
@@ -136,7 +136,8 @@ namespace gr {
// First index of d_b is Bit interleaver number
// Second index of d_b is the position inside the Bit interleaver
- unsigned char d_b[d_v][d_bsize];
+ // Linux: unsigned char d_b[d_v][d_bsize];
+ __GR_VLA2D(unsigned char, d_b, d_v, d_bsize);
for (int bcount = 0; bcount < bmax; bcount++) {
for (int i = 0; i < d_bsize; i++) {
diff --git a/gr-dtv/lib/dvbt/dvbt_ofdm_sym_acquisition_impl.cc b/gr-dtv/lib/dvbt/dvbt_ofdm_sym_acquisition_impl.cc
index b6eacade63..ee8dce0f15 100644
--- a/gr-dtv/lib/dvbt/dvbt_ofdm_sym_acquisition_impl.cc
+++ b/gr-dtv/lib/dvbt/dvbt_ofdm_sym_acquisition_impl.cc
@@ -103,8 +103,8 @@ namespace gr {
int low, size;
// Array to store peak positions
- int peak_pos[d_fft_length];
- float d_phi[d_fft_length];
+ __GR_VLA(int, peak_pos, d_fft_length);
+ __GR_VLA(float, d_phi, d_fft_length);
// Calculate norm
low = lookup_stop - (d_cp_length + d_fft_length - 1);
diff --git a/gr-dtv/lib/dvbt/dvbt_reed_solomon.cc b/gr-dtv/lib/dvbt/dvbt_reed_solomon.cc
index 6277350b42..7d67a0a81a 100644
--- a/gr-dtv/lib/dvbt/dvbt_reed_solomon.cc
+++ b/gr-dtv/lib/dvbt/dvbt_reed_solomon.cc
@@ -245,13 +245,13 @@ namespace gr {
int
dvbt_reed_solomon::rs_decode(unsigned char *data, unsigned char *eras, const int no_eras)
{
- unsigned char sigma[2 * d_t + 1];
- unsigned char b[2 * d_t + 1];
- unsigned char T[2 * d_t + 1];
- unsigned char reg[2 * d_t + 1];
- unsigned char root[2 * d_t + 1];
- unsigned char loc[2 * d_t + 1];
- unsigned char omega[2 * d_t];
+ __GR_VLA(unsigned char, sigma, 2 * d_t + 1);
+ __GR_VLA(unsigned char, b, 2 * d_t + 1);
+ __GR_VLA(unsigned char, T, 2 * d_t + 1);
+ __GR_VLA(unsigned char, reg, 2 * d_t + 1);
+ __GR_VLA(unsigned char, root, 2 * d_t + 1);
+ __GR_VLA(unsigned char, loc, 2 * d_t + 1);
+ __GR_VLA(unsigned char, omega, 2 * d_t);
// Compute erasure locator polynomial
memset(sigma, 0, 2 * d_t + 1);
diff --git a/gr-dtv/lib/dvbt/dvbt_viterbi_decoder_impl.cc b/gr-dtv/lib/dvbt/dvbt_viterbi_decoder_impl.cc
index 8e22d8df5a..05554c55fa 100644
--- a/gr-dtv/lib/dvbt/dvbt_viterbi_decoder_impl.cc
+++ b/gr-dtv/lib/dvbt/dvbt_viterbi_decoder_impl.cc
@@ -71,25 +71,25 @@ namespace gr {
};
#ifdef DTV_SSE2
- __m128i dvbt_viterbi_decoder_impl::d_metric0[4] __attribute__ ((aligned(16)));
- __m128i dvbt_viterbi_decoder_impl::d_metric1[4] __attribute__ ((aligned(16)));
- __m128i dvbt_viterbi_decoder_impl::d_path0[4] __attribute__ ((aligned(16)));
- __m128i dvbt_viterbi_decoder_impl::d_path1[4] __attribute__ ((aligned(16)));
+ __GR_ATTR_ALIGNED(16) __m128i dvbt_viterbi_decoder_impl::d_metric0[4];
+ __GR_ATTR_ALIGNED(16) __m128i dvbt_viterbi_decoder_impl::d_metric1[4];
+ __GR_ATTR_ALIGNED(16) __m128i dvbt_viterbi_decoder_impl::d_path0[4];
+ __GR_ATTR_ALIGNED(16) __m128i dvbt_viterbi_decoder_impl::d_path1[4];
#else
- unsigned char dvbt_viterbi_decoder_impl::d_metric0_generic[64] __attribute__ ((aligned(16)));
- unsigned char dvbt_viterbi_decoder_impl::d_metric1_generic[64] __attribute__ ((aligned(16)));
- unsigned char dvbt_viterbi_decoder_impl::d_path0_generic[64] __attribute__ ((aligned(16)));
- unsigned char dvbt_viterbi_decoder_impl::d_path1_generic[64] __attribute__ ((aligned(16)));
+ __GR_ATTR_ALIGNED(16) unsigned char dvbt_viterbi_decoder_impl::d_metric0_generic[64];
+ __GR_ATTR_ALIGNED(16) unsigned char dvbt_viterbi_decoder_impl::d_metric1_generic[64];
+ __GR_ATTR_ALIGNED(16) unsigned char dvbt_viterbi_decoder_impl::d_path0_generic[64];
+ __GR_ATTR_ALIGNED(16) unsigned char dvbt_viterbi_decoder_impl::d_path1_generic[64];
#endif
#ifdef DTV_SSE2
- branchtab27 dvbt_viterbi_decoder_impl::Branchtab27_sse2[2] __attribute__ ((aligned(16)));
+ __GR_ATTR_ALIGNED(16) branchtab27 dvbt_viterbi_decoder_impl::Branchtab27_sse2[2];
#else
- branchtab27 dvbt_viterbi_decoder_impl::Branchtab27_generic[2] __attribute__ ((aligned(16)));
+ __GR_ATTR_ALIGNED(16) branchtab27 dvbt_viterbi_decoder_impl::Branchtab27_generic[2];
#endif
- unsigned char dvbt_viterbi_decoder_impl::mmresult[64] __attribute__((aligned(16)));
- unsigned char dvbt_viterbi_decoder_impl::ppresult[TRACEBACK_MAX][64] __attribute__((aligned(16)));
+ __GR_ATTR_ALIGNED(16) unsigned char dvbt_viterbi_decoder_impl::mmresult[64];
+ __GR_ATTR_ALIGNED(16) unsigned char dvbt_viterbi_decoder_impl::ppresult[TRACEBACK_MAX][64];
#ifdef DTV_SSE2
void
diff --git a/gr-qtgui/lib/CMakeLists.txt b/gr-qtgui/lib/CMakeLists.txt
index 92a2456e2b..4827ec4f3f 100644
--- a/gr-qtgui/lib/CMakeLists.txt
+++ b/gr-qtgui/lib/CMakeLists.txt
@@ -160,6 +160,11 @@ list(APPEND qtgui_libs
${FFTW3F_LIBRARIES}
${LOG4CPP_LIBRARIES}
)
+if (WIN32)
+ list(APPEND qtgui_libs
+ dwrite
+ )
+endif(WIN32)
include(GrPython)
if(ENABLE_PYTHON)
diff --git a/gr-vocoder/lib/codec2/fdmdv.c b/gr-vocoder/lib/codec2/fdmdv.c
index 8855f76ae5..51d6bef544 100644
--- a/gr-vocoder/lib/codec2/fdmdv.c
+++ b/gr-vocoder/lib/codec2/fdmdv.c
@@ -25,7 +25,7 @@
along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
-#ifdef _MSC_VER
+#if defined(_MSC_VER) && (_MSC_VER < 1800) // round() not available before VS 2013
#define round(number) number < 0.0 ? ceil(number - 0.5) : floor(number + 0.5)
#endif
diff --git a/gr-zeromq/lib/pull_msg_source_impl.cc b/gr-zeromq/lib/pull_msg_source_impl.cc
index ca496ef216..9d00cdfd74 100644
--- a/gr-zeromq/lib/pull_msg_source_impl.cc
+++ b/gr-zeromq/lib/pull_msg_source_impl.cc
@@ -25,6 +25,8 @@
#endif
#include <gnuradio/io_signature.h>
+#include <boost/thread/thread.hpp>
+#include <boost/date_time/posix_time/posix_time.hpp>
#include "pull_msg_source_impl.h"
#include "tag_headers.h"
@@ -102,7 +104,7 @@ namespace gr {
message_port_pub(pmt::mp("out"), m);
} else {
- usleep(100);
+ boost::this_thread::sleep(boost::posix_time::microseconds(100));
}
}
}
diff --git a/gr-zeromq/lib/req_msg_source_impl.cc b/gr-zeromq/lib/req_msg_source_impl.cc
index b30ef2679d..e231a31962 100644
--- a/gr-zeromq/lib/req_msg_source_impl.cc
+++ b/gr-zeromq/lib/req_msg_source_impl.cc
@@ -25,6 +25,8 @@
#endif
#include <gnuradio/io_signature.h>
+#include <boost/thread/thread.hpp>
+#include <boost/date_time/posix_time/posix_time.hpp>
#include "req_msg_source_impl.h"
#include "tag_headers.h"
@@ -114,7 +116,7 @@ namespace gr {
message_port_pub(pmt::mp("out"), m);
} else {
- usleep(100);
+ boost::this_thread::sleep(boost::posix_time::microseconds(100));
}
}
}
diff --git a/gr-zeromq/lib/sub_msg_source_impl.cc b/gr-zeromq/lib/sub_msg_source_impl.cc
index b016405d40..0a11ea77f0 100644
--- a/gr-zeromq/lib/sub_msg_source_impl.cc
+++ b/gr-zeromq/lib/sub_msg_source_impl.cc
@@ -25,6 +25,8 @@
#endif
#include <gnuradio/io_signature.h>
+#include <boost/thread/thread.hpp>
+#include <boost/date_time/posix_time/posix_time.hpp>
#include "sub_msg_source_impl.h"
#include "tag_headers.h"
@@ -101,7 +103,7 @@ namespace gr {
message_port_pub(pmt::mp("out"), m);
} else {
- usleep(100);
+ boost::this_thread::sleep(boost::posix_time::microseconds(100));
}
}
}