diff options
-rw-r--r-- | config.h.in | 6 | ||||
-rw-r--r-- | gnuradio-runtime/include/gnuradio/logger.h.in | 51 | ||||
-rw-r--r-- | gr-audio/include/gnuradio/audio/osx_impl.h | 14 | ||||
-rw-r--r-- | gr-audio/lib/osx/osx_common.h | 5 | ||||
-rw-r--r-- | gr-audio/lib/osx/osx_impl.cc | 8 |
5 files changed, 65 insertions, 19 deletions
diff --git a/config.h.in b/config.h.in index ad6e3d022c..e1f98cdac4 100644 --- a/config.h.in +++ b/config.h.in @@ -36,11 +36,5 @@ #ifndef GR_RPCSERVER_THRIFT #cmakedefine GR_RPCSERVER_THRIFT #endif -#ifndef ENABLE_GR_LOG -#cmakedefine ENABLE_GR_LOG -#endif -#ifndef HAVE_LOG4CPP -#cmakedefine HAVE_LOG4CPP -#endif #endif /* GNURADIO_CONFIG_H */ diff --git a/gnuradio-runtime/include/gnuradio/logger.h.in b/gnuradio-runtime/include/gnuradio/logger.h.in index 08cb209c7b..13fda6f6c4 100644 --- a/gnuradio-runtime/include/gnuradio/logger.h.in +++ b/gnuradio-runtime/include/gnuradio/logger.h.in @@ -35,13 +35,60 @@ * */ -#ifndef ENABLE_GR_LOG +// handle current status of GR_LOG +#ifdef EXT_ENABLE_GR_LOG +#undef EXT_ENABLE_GR_LOG +#endif +#ifdef ENABLE_GR_LOG +#define EXT_ENABLE_GR_LOG +#undef ENABLE_GR_LOG +#endif + +// did GR enable LOG? #cmakedefine ENABLE_GR_LOG + +// if GR does not provide logging and the current module is requesting +// it, disable it. +#if defined(EXT_ENABLE_GR_LOG) && !defined(ENABLE_GR_LOG) +#warning "Logging was requested but is not enabled in GNU Radio, so disabling." +#undef EXT_ENABLE_GR_LOG #endif -#ifndef HAVE_LOG4CPP + +// if GR provides logging but the current module is not requesting it, +// disable it. +#if !defined(EXT_ENABLE_GR_LOG) && defined(ENABLE_GR_LOG) +#undef ENABLE_GR_LOG +#endif + +// the other 2 cases work; no need to check them! + +// handle current status of LOG4CPP +#ifdef EXT_HAVE_LOG4CPP +#undef EXT_HAVE_LOG4CPP +#endif +#ifdef HAVE_LOG4CPP +#define EXT_HAVE_LOG4CPP +#undef HAVE_LOG4CPP +#endif + +// did GR use log4cpp? #cmakedefine HAVE_LOG4CPP + +// if GR does not use log4cpp and the current module is requesting it, +// disable it & print a warning. +#if defined(EXT_HAVE_LOG4CPP) && !defined(HAVE_LOG4CPP) +#warning "Log4Cpp use was requested but was not in GNU Radio, so disabling." +#undef EXT_HAVE_LOG4CPP +#endif + +// if GR provides for using log4cpp but the current module is not +// requesting it, disable it quietly. +#if !defined(EXT_HAVE_LOG4CPP) && defined(HAVE_LOG4CPP) +#undef HAVE_LOG4CPP #endif +// the other 2 cases work; no need to check them! + #ifdef _MSC_VER typedef unsigned short mode_t; #else diff --git a/gr-audio/include/gnuradio/audio/osx_impl.h b/gr-audio/include/gnuradio/audio/osx_impl.h index 891685a335..6db130447e 100644 --- a/gr-audio/include/gnuradio/audio/osx_impl.h +++ b/gr-audio/include/gnuradio/audio/osx_impl.h @@ -33,10 +33,6 @@ #include <AudioToolbox/AudioToolbox.h> #include <AudioUnit/AudioUnit.h> -namespace gr { -namespace audio { -namespace osx { - // Check the version of MacOSX being used #ifdef __APPLE_CC__ #include <AvailabilityMacros.h> @@ -50,15 +46,19 @@ namespace osx { // helper function to print an ASBD -extern std::ostream& GR_AUDIO_API +std::ostream& GR_AUDIO_API operator<< (std::ostream& s, const AudioStreamBasicDescription& asbd); +namespace gr { +namespace audio { +namespace osx { + // returns the number of channels for the provided AudioDeviceID, // input and/or output depending on if the pointer is valid. -extern void GR_AUDIO_API +void GR_AUDIO_API get_num_channels_for_audio_device_id (AudioDeviceID ad_id, UInt32* n_input, @@ -70,7 +70,7 @@ get_num_channels_for_audio_device_id // matching names. If the device name is empty, then match all // input or output devices. -extern void GR_AUDIO_API +void GR_AUDIO_API find_audio_devices (const std::string& device_name, bool is_input, diff --git a/gr-audio/lib/osx/osx_common.h b/gr-audio/lib/osx/osx_common.h index 59b866dbe3..5d8a3800a5 100644 --- a/gr-audio/lib/osx/osx_common.h +++ b/gr-audio/lib/osx/osx_common.h @@ -29,8 +29,13 @@ namespace gr { namespace audio { namespace osx { +#ifndef _OSX_AU_DEBUG_ #define _OSX_AU_DEBUG_ 0 +#endif + +#ifndef _OSX_AU_DEBUG_RENDER_ #define _OSX_AU_DEBUG_RENDER_ 0 +#endif #define check_error_and_throw(err,what,throw_str) \ if(err) { \ diff --git a/gr-audio/lib/osx/osx_impl.cc b/gr-audio/lib/osx/osx_impl.cc index aa0320d18a..d18c24c786 100644 --- a/gr-audio/lib/osx/osx_impl.cc +++ b/gr-audio/lib/osx/osx_impl.cc @@ -33,10 +33,6 @@ #include <locale> #include <stdexcept> -namespace gr { -namespace audio { -namespace osx { - std::ostream& operator<< (std::ostream& s, @@ -70,6 +66,10 @@ operator<< return(s); }; +namespace gr { +namespace audio { +namespace osx { + static UInt32 _get_num_channels (AudioDeviceID ad_id, |