'libs/rubberband' - Platform specific includes
authorJohn Emmas <johne53@tiscali.co.uk>
Thu, 25 Jul 2013 08:14:40 +0000 (09:14 +0100)
committerJohn Emmas <johne53@tiscali.co.uk>
Thu, 25 Jul 2013 08:14:40 +0000 (09:14 +0100)
libs/rubberband/src/Profiler.h
libs/rubberband/src/RingBuffer.h
libs/rubberband/src/Scavenger.h
libs/rubberband/src/Thread.cpp
libs/rubberband/src/Thread.h
libs/rubberband/src/main.cpp

index 616a553ecb2d10fc8e96354044985fca277f5591..d6897b817b7f7d8631bc709789cd676285f46598 100644 (file)
@@ -31,7 +31,7 @@
 #include <time.h>
 #else
 #include "sysutils.h"
-#ifndef _WIN32
+#ifndef PLATFORM_WINDOWS
 #include <sys/time.h>
 #endif
 #endif
index 07312169a6449c514a2c9a388cc917012d6384c6..a9262c8cdc04f6d2d443c205a2bfad016dfabdaf 100644 (file)
@@ -20,7 +20,7 @@
 
 #include <cstring>
 
-#ifndef _WIN32
+#ifndef PLATFORM_WINDOWS
 #include <sys/mman.h>
 #endif
 
@@ -30,7 +30,7 @@
 
 //#define DEBUG_RINGBUFFER 1
 
-#ifdef _WIN32
+#ifdef PLATFORM_WINDOWS
 #define MLOCK(a,b) 1
 #define MUNLOCK(a,b) 1
 #else
index d1b6ca9ffac3df899c61ceb8d03bc2aefdd2fb20..a922d7ec6ef7256fd0b2bc76f386de5869fc5aa0 100644 (file)
@@ -19,7 +19,7 @@
 #include <list>
 #include <iostream>
 
-#ifndef WIN32
+#ifndef PLATFORM_WINDOWS
 #include <sys/time.h>
 #endif
 
index 959515afc7d284f0b505ccb60e103781e26c3c68..d5a7b2f6ff1c6e25e463816408e8b9cdcd891b8c 100644 (file)
@@ -29,7 +29,7 @@ using std::string;
 namespace RubberBand
 {
 
-#ifdef _WIN32
+#ifdef PLATFORM_WINDOWS
 
 Thread::Thread() :
     m_id(0),
@@ -289,7 +289,7 @@ Condition::signal()
     SetEvent(m_condition);
 }
 
-#else /* !_WIN32 */
+#else /* !PLATFORM_WINDOWS */
 
 
 Thread::Thread() :
@@ -562,7 +562,7 @@ Condition::signal()
     pthread_cond_signal(&m_condition);
 }
 
-#endif /* !_WIN32 */
+#endif /* !PLATFORM_WINDOWS */
 
 MutexLocker::MutexLocker(Mutex *mutex) :
     m_mutex(mutex)
index 061469297e6f8a6c76eaa4f93771a4d487feb7a0..63a5a65b67fdd94e396e00995249519b3e20801e 100644 (file)
 #ifndef _RUBBERBAND_THREAD_H_
 #define _RUBBERBAND_THREAD_H_
 
-#ifdef _WIN32
+#ifdef PLATFORM_WINDOWS
 #include <windows.h>
-#else /* !_WIN32 */
+#else /* !PLATFORM_WINDOWS */
 #include <pthread.h>
-#endif /* !_WIN32 */
+#endif /* !PLATFORM_WINDOWS */
 
 #include <string>
 
@@ -33,7 +33,7 @@ namespace RubberBand
 class Thread
 {
 public:
-#ifdef _WIN32
+#ifdef PLATFORM_WINDOWS
     typedef HANDLE Id;
 #else
     typedef pthread_t Id;
@@ -53,7 +53,7 @@ protected:
     virtual void run() = 0;
 
 private:
-#ifdef _WIN32
+#ifdef PLATFORM_WINDOWS
     HANDLE m_id;
     bool m_extant;
     static DWORD WINAPI staticRun(LPVOID lpParam);
@@ -75,7 +75,7 @@ public:
     bool trylock();
 
 private:
-#ifdef _WIN32
+#ifdef PLATFORM_WINDOWS
     HANDLE m_mutex;
 #ifndef NO_THREAD_CHECKS
     DWORD m_lockedBy;
@@ -123,7 +123,7 @@ public:
     
 private:
 
-#ifdef _WIN32
+#ifdef PLATFORM_WINDOWS
     HANDLE m_mutex;
     HANDLE m_condition;
     bool m_locked;
index 5f1d2ba9c379a99fb81d045800b001dda1f855b2..cdc62e8afa232c3c44f177728377fbdb9d9dff02 100644 (file)
@@ -36,7 +36,7 @@
 using namespace std;
 using namespace RubberBand;
 
-#ifdef _WIN32
+#ifdef PLATFORM_WINDOWS
 using RubberBand::gettimeofday;
 using RubberBand::usleep;
 #endif
@@ -324,7 +324,7 @@ int main(int argc, char **argv)
     cerr << "Using time ratio " << ratio;
     cerr << " and frequency ratio " << frequencyshift << endl;
 
-#ifdef _WIN32
+#ifdef PLATFORM_WINDOWS
     RubberBand::
 #endif
     timeval tv;
@@ -495,7 +495,7 @@ int main(int argc, char **argv)
             }
             delete[] obf;
         } else {
-#ifdef WIN32
+#ifdef PLATFORM_WINDOWS
             RubberBand::usleep(10000);
 #else
             usleep(10000);
@@ -510,7 +510,7 @@ int main(int argc, char **argv)
 
         cerr << "in: " << countIn << ", out: " << countOut << ", ratio: " << float(countOut)/float(countIn) << ", ideal output: " << lrint(countIn * ratio) << ", error: " << abs(lrint(countIn * ratio) - int(countOut)) << endl;
 
-#ifdef _WIN32
+#ifdef PLATFORM_WINDOWS
         RubberBand::
 #endif
         timeval etv;