summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gr-audio/lib/osx/osx_common.h12
-rw-r--r--gr-audio/lib/osx/osx_source.cc6
-rw-r--r--volk/lib/CMakeLists.txt16
3 files changed, 24 insertions, 10 deletions
diff --git a/gr-audio/lib/osx/osx_common.h b/gr-audio/lib/osx/osx_common.h
index 34266f2c63..59b866dbe3 100644
--- a/gr-audio/lib/osx/osx_common.h
+++ b/gr-audio/lib/osx/osx_common.h
@@ -35,9 +35,9 @@ namespace osx {
#define check_error_and_throw(err,what,throw_str) \
if(err) { \
OSStatus error = static_cast<OSStatus>(err); \
- char err_str[5]; \
- *((UInt32*)err_str) = error; \
- err_str[4] = 0; \
+ char err_str[sizeof(OSStatus)+1]; \
+ memcpy((void*)(&err_str), (void*)(&error), sizeof(OSStatus)); \
+ err_str[sizeof(OSStatus)] = 0; \
GR_LOG_FATAL(d_logger, boost::format(what)); \
GR_LOG_FATAL(d_logger, boost::format(" Error# %u ('%s')") \
% error % err_str); \
@@ -49,9 +49,9 @@ namespace osx {
#define check_error(err,what) \
if(err) { \
OSStatus error = static_cast<OSStatus>(err); \
- char err_str[5]; \
- *((UInt32*)err_str) = error; \
- err_str[4] = 0; \
+ char err_str[sizeof(OSStatus)+1]; \
+ memcpy((void*)(&err_str), (void*)(&error), sizeof(OSStatus)); \
+ err_str[sizeof(OSStatus)] = 0; \
GR_LOG_WARN(d_logger, boost::format(what)); \
GR_LOG_WARN(d_logger, boost::format(" Error# %u ('%s')") \
% error % err_str); \
diff --git a/gr-audio/lib/osx/osx_source.cc b/gr-audio/lib/osx/osx_source.cc
index 93d857e4be..b51a6563ed 100644
--- a/gr-audio/lib/osx/osx_source.cc
+++ b/gr-audio/lib/osx/osx_source.cc
@@ -933,8 +933,7 @@ namespace gr {
err = AudioHardwareRemovePropertyListener
(kAudioHardwarePropertyDevices,
reinterpret_cast<AudioHardwarePropertyListenerProc>
- (&osx_source::hardware_listener)
- reinterpret_cast<void*>(this));
+ (&osx_source::hardware_listener));
#if _OSX_AU_DEBUG_
check_error(err, "AudioObjectRemovePropertyListener hardware");
#endif
@@ -943,8 +942,7 @@ namespace gr {
err = AudioHardwareRemovePropertyListener
(kAudioHardwarePropertyDefaultInputDevice,
reinterpret_cast<AudioHardwarePropertyListenerProc>
- (&osx_source::default_listener),
- reinterpret_cast<void*>(this));
+ (&osx_source::default_listener));
#if _OSX_AU_DEBUG_
check_error(err, "AudioObjectRemovePropertyListener default");
#endif
diff --git a/volk/lib/CMakeLists.txt b/volk/lib/CMakeLists.txt
index d2e4e62212..e25c5c65c7 100644
--- a/volk/lib/CMakeLists.txt
+++ b/volk/lib/CMakeLists.txt
@@ -205,6 +205,22 @@ if(${HAVE_AVX_CVTPI32_PS})
add_definitions(-DHAVE_AVX_CVTPI32_PS)
endif()
+########################################################################
+# if the CPU is not x86, eliminate all Intel SIMD
+########################################################################
+
+if(NOT CPU_IS_x86)
+ OVERRULE_ARCH(3dnow "Architecture is not x86 or x86_64")
+ OVERRULE_ARCH(mmx "Architecture is not x86 or x86_64")
+ OVERRULE_ARCH(sse "Architecture is not x86 or x86_64")
+ OVERRULE_ARCH(sse2 "Architecture is not x86 or x86_64")
+ OVERRULE_ARCH(sse3 "Architecture is not x86 or x86_64")
+ OVERRULE_ARCH(ssse3 "Architecture is not x86 or x86_64")
+ OVERRULE_ARCH(sse4_a "Architecture is not x86 or x86_64")
+ OVERRULE_ARCH(sse4_1 "Architecture is not x86 or x86_64")
+ OVERRULE_ARCH(sse4_2 "Architecture is not x86 or x86_64")
+ OVERRULE_ARCH(avx "Architecture is not x86 or x86_64")
+endif(NOT CPU_IS_x86)
########################################################################
# implement overruling in the ORC case,