second part of windows/osx macro change - forgot *.cpp files

This commit is contained in:
Paul Davis 2014-05-01 09:39:11 -04:00
parent 49423427a6
commit fa139421b9
4 changed files with 19 additions and 19 deletions

View file

@ -7,7 +7,7 @@
//! WCMRNativeAudioConnection and related class defienitions //! WCMRNativeAudioConnection and related class defienitions
//! //!
//---------------------------------------------------------------------------------*/ //---------------------------------------------------------------------------------*/
#if defined(__MACOS__) #if defined(__APPLE__)
#include <CoreAudio/CoreAudio.h> #include <CoreAudio/CoreAudio.h>
#endif #endif
@ -34,7 +34,7 @@
WCMRNativeAudioNoneDevice::WCMRNativeAudioNoneDevice (WCMRAudioDeviceManager *pManager) WCMRNativeAudioNoneDevice::WCMRNativeAudioNoneDevice (WCMRAudioDeviceManager *pManager)
: WCMRNativeAudioDevice (pManager, false /*useMultiThreading*/) : WCMRNativeAudioDevice (pManager, false /*useMultiThreading*/)
, m_SilenceThread(0) , m_SilenceThread(0)
#if defined (_WINDOWS) #if defined (PLATFORM_WINDOWS)
, _waitableTimerForUsleep (CreateWaitableTimer(NULL, TRUE, NULL)) , _waitableTimerForUsleep (CreateWaitableTimer(NULL, TRUE, NULL))
#endif #endif
{ {
@ -66,7 +66,7 @@ WCMRNativeAudioNoneDevice::WCMRNativeAudioNoneDevice (WCMRAudioDeviceManager *pM
WCMRNativeAudioNoneDevice::~WCMRNativeAudioNoneDevice () WCMRNativeAudioNoneDevice::~WCMRNativeAudioNoneDevice ()
{ {
#if defined (_WINDOWS) #if defined (PLATFORM_WINDOWS)
if(_waitableTimerForUsleep) { if(_waitableTimerForUsleep) {
CloseHandle(_waitableTimerForUsleep); CloseHandle(_waitableTimerForUsleep);
} }
@ -141,7 +141,7 @@ WTErr WCMRNativeAudioNoneDevice::SetStreaming (bool newState)
pthread_attr_t attributes; pthread_attr_t attributes;
size_t stack_size = 100000; size_t stack_size = 100000;
#ifdef __MACOS__ #ifdef __APPLE__
stack_size = (((stack_size - 1) / PTHREAD_STACK_MIN) + 1) * PTHREAD_STACK_MIN; stack_size = (((stack_size - 1) / PTHREAD_STACK_MIN) + 1) * PTHREAD_STACK_MIN;
#endif #endif
if (pthread_attr_init (&attributes)) { if (pthread_attr_init (&attributes)) {
@ -178,7 +178,7 @@ WTErr WCMRNativeAudioNoneDevice::SetStreaming (bool newState)
void WCMRNativeAudioNoneDevice::_SilenceThread() void WCMRNativeAudioNoneDevice::_SilenceThread()
{ {
#if defined(_WINDOWS) #if defined(PLATFORM_WINDOWS)
float* theInpBuffers[__m_NumInputChannels]; float* theInpBuffers[__m_NumInputChannels];
for(int i = 0; i < __m_NumInputChannels; ++i) for(int i = 0; i < __m_NumInputChannels; ++i)
{ {
@ -228,7 +228,7 @@ void* WCMRNativeAudioNoneDevice::__SilenceThread(void *This)
return 0; return 0;
} }
#if defined(_WINDOWS) #if defined(PLATFORM_WINDOWS)
void WCMRNativeAudioNoneDevice::_usleep(uint64_t duration_usec) void WCMRNativeAudioNoneDevice::_usleep(uint64_t duration_usec)
{ {
LARGE_INTEGER ft; LARGE_INTEGER ft;
@ -243,13 +243,13 @@ void WCMRNativeAudioNoneDevice::_usleep(uint64_t duration_usec)
uint64_t uint64_t
WCMRNativeAudioNoneDevice::__get_time_nanos () WCMRNativeAudioNoneDevice::__get_time_nanos ()
{ {
#ifdef __MACOS__ #ifdef __APPLE__
// here we exploit the time counting API which is used by the WCMRCoreAudioDeviceManager. However, // here we exploit the time counting API which is used by the WCMRCoreAudioDeviceManager. However,
// the API should be a part of WCMRCoreAudioDeviceManager to give a chance of being tied to the // the API should be a part of WCMRCoreAudioDeviceManager to give a chance of being tied to the
// audio device transport timeß. // audio device transport timeß.
return AudioConvertHostTimeToNanos (AudioGetCurrentHostTime ()); return AudioConvertHostTimeToNanos (AudioGetCurrentHostTime ());
#elif _WINDOWS #elif PLATFORM_WINDOWS
LARGE_INTEGER Frequency, Count ; LARGE_INTEGER Frequency, Count ;

View file

@ -1033,7 +1033,7 @@ void WCMRPortAudioDevice::resetDevice (bool callerIsWaiting /*=false*/ )
} }
#ifdef _WINDOWS #ifdef PLATFORM_WINDOWS
long WCMRPortAudioDevice::StaticASIOMessageHook (void *pRefCon, long selector, long value, void* message, double* opt) long WCMRPortAudioDevice::StaticASIOMessageHook (void *pRefCon, long selector, long value, void* message, double* opt)
{ {
@ -1250,7 +1250,7 @@ WTErr WCMRPortAudioDevice::ShowConfigPanel (void *pParam)
if (Active()) if (Active())
{ {
#ifdef _WINDOWS #ifdef PLATFORM_WINDOWS
if(Pa_GetHostApiInfo(Pa_GetDeviceInfo(m_DeviceID)->hostApi)->type == paASIO) if(Pa_GetHostApiInfo(Pa_GetDeviceInfo(m_DeviceID)->hostApi)->type == paASIO)
{ {
// stop and deactivate the device // stop and deactivate the device

View file

@ -1,7 +1,7 @@
#ifdef _WINDOWS #ifdef PLATFORM_WINDOWS
#include "IncludeWindows.h" #include "IncludeWindows.h"
#endif #endif
#if defined(__linux__) || defined(__MACOS__) #if defined(__linux__) || defined(__APPLE__)
#include <sys/time.h> #include <sys/time.h>
#endif #endif
@ -10,7 +10,7 @@
namespace wvNS { namespace wvNS {
UMicroseconds& UMicroseconds::ReadTime() UMicroseconds& UMicroseconds::ReadTime()
{ {
#ifdef _WINDOWS #ifdef PLATFORM_WINDOWS
LARGE_INTEGER Frequency, Count ; LARGE_INTEGER Frequency, Count ;
QueryPerformanceFrequency(&Frequency) ; QueryPerformanceFrequency(&Frequency) ;
@ -18,7 +18,7 @@ UMicroseconds& UMicroseconds::ReadTime()
theTime = uint64_t((Count.QuadPart * 1000000.0 / Frequency.QuadPart)); theTime = uint64_t((Count.QuadPart * 1000000.0 / Frequency.QuadPart));
#endif #endif
#if defined(__linux__) || defined(__MACOS__) #if defined(__linux__) || defined(__APPLE__)
// Mac code replaced by posix calls, to reduce Carbon dependency. // Mac code replaced by posix calls, to reduce Carbon dependency.
timeval buf; timeval buf;
@ -32,7 +32,7 @@ UMicroseconds& UMicroseconds::ReadTime()
} }
/* /*
Removed in favor of the posix implementation. Removed in favor of the posix implementation.
#ifdef __MACOS__ #ifdef __APPLE__
uint32_t UMicroseconds::hi() {return reinterpret_cast<UnsignedWide*>(&theTime)->hi;} uint32_t UMicroseconds::hi() {return reinterpret_cast<UnsignedWide*>(&theTime)->hi;}
uint32_t UMicroseconds::lo() {return reinterpret_cast<UnsignedWide*>(&theTime)->lo;} uint32_t UMicroseconds::lo() {return reinterpret_cast<UnsignedWide*>(&theTime)->lo;}
#endif #endif

View file

@ -7,10 +7,10 @@
#endif // XPLATFORMTHREADS_WINDOWS #endif // XPLATFORMTHREADS_WINDOWS
#if defined(__MACOS__) #if defined(__APPLE__)
#include <CoreServices/CoreServices.h> #include <CoreServices/CoreServices.h>
#include <stdio.h> #include <stdio.h>
#endif // __MACOS__ #endif // __APPLE__
#if XPLATFORMTHREADS_POSIX #if XPLATFORMTHREADS_POSIX
#include </usr/include/unistd.h> // avoid the framework version and use the /usr/include version #include </usr/include/unistd.h> // avoid the framework version and use the /usr/include version
@ -87,7 +87,7 @@ namespace wvThread
return nTicksPerMicrosecond; return nTicksPerMicrosecond;
} }
#if defined(__MACOS__) //&& !defined(__MACH__) #if defined(__APPLE__) //&& !defined(__MACH__)
bool FindNetInterfaceByIPAddress(const char *sIP, char *sInterface) // sIP and sInterface are both char[16] bool FindNetInterfaceByIPAddress(const char *sIP, char *sInterface) // sIP and sInterface are both char[16]
@ -143,7 +143,7 @@ namespace wvThread
return timestamp(uint32_t(TSC.QuadPart/nTicksPerMicrosecond)); return timestamp(uint32_t(TSC.QuadPart/nTicksPerMicrosecond));
} }
else return timestamp(0); else return timestamp(0);
#elif defined(__MACOS__) #elif defined(__APPLE__)
if (nTicksPerMicrosecond) {} // prevent 'unused' warnings if (nTicksPerMicrosecond) {} // prevent 'unused' warnings
UnsignedWide usecs; UnsignedWide usecs;
::Microseconds(&usecs); ::Microseconds(&usecs);