13
0

'libs/midi++2' - Platform specific includes

This commit is contained in:
John Emmas 2013-07-25 07:45:24 +01:00
parent eb2c419620
commit e5ab8c1c9e
5 changed files with 13 additions and 13 deletions

View File

@ -29,13 +29,13 @@
#undef O_NONBLOCK #undef O_NONBLOCK
#define O_NONBLOCK 0 #define O_NONBLOCK 0
#endif #endif
#if defined(WIN32) #if defined(PLATFORM_WINDOWS)
#include <winsock2.h> #include <winsock2.h>
#else #else
#include <netdb.h> #include <netdb.h>
#endif #endif
#if defined(WIN32) #if defined(PLATFORM_WINDOWS)
static WSADATA g_wsaData; static WSADATA g_wsaData;
typedef int socklen_t; typedef int socklen_t;
#else #else
@ -120,7 +120,7 @@ get_address (int sock, struct in_addr *inaddr, const string& ifname )
{ {
// Get interface address from supplied name. // Get interface address from supplied name.
#if !defined(WIN32) #if !defined(PLATFORM_WINDOWS)
struct ifreq ifr; struct ifreq ifr;
::strncpy(ifr.ifr_name, ifname.c_str(), sizeof(ifr.ifr_name)); ::strncpy(ifr.ifr_name, ifname.c_str(), sizeof(ifr.ifr_name));
@ -149,13 +149,13 @@ get_address (int sock, struct in_addr *inaddr, const string& ifname )
return false; return false;
#endif // !WIN32 #endif // !PLATFORM_WINDOWS'
} }
bool bool
IPMIDIPort::open_sockets (int base_port, const string& ifname) IPMIDIPort::open_sockets (int base_port, const string& ifname)
{ {
#if !defined(WIN32) #if !defined(PLATFORM_WINDOWS)
int protonum = 0; int protonum = 0;
struct protoent *proto = ::getprotobyname("IP"); struct protoent *proto = ::getprotobyname("IP");
@ -254,7 +254,7 @@ IPMIDIPort::open_sockets (int base_port, const string& ifname)
return true; return true;
#else #else
return false; return false;
#endif // !WIN32 #endif // !PLATFORM_WINDOWS'
} }
int int

View File

@ -58,7 +58,7 @@ JackMIDIPort::JackMIDIPort (string const & name, Flags flags, jack_client_t* jac
, _last_write_timestamp (0) , _last_write_timestamp (0)
, output_fifo (512) , output_fifo (512)
, input_fifo (1024) , input_fifo (1024)
#ifndef WIN32 #ifndef PLATFORM_WINDOWS
, xthread (true) , xthread (true)
#endif #endif
{ {
@ -75,7 +75,7 @@ JackMIDIPort::JackMIDIPort (const XMLNode& node, jack_client_t* jack_client)
, _last_write_timestamp (0) , _last_write_timestamp (0)
, output_fifo (512) , output_fifo (512)
, input_fifo (1024) , input_fifo (1024)
#ifndef WIN32 #ifndef PLATFORM_WINDOWS
, xthread (true) , xthread (true)
#endif #endif
{ {
@ -174,7 +174,7 @@ JackMIDIPort::cycle_start (pframes_t nframes)
} }
if (event_count) { if (event_count) {
#ifndef WIN32 #ifndef PLATFORM_WINDOWS
xthread.wakeup (); xthread.wakeup ();
#endif #endif
} }

View File

@ -21,7 +21,7 @@
#include <string> #include <string>
#include <iostream> #include <iostream>
#if defined(WIN32) #if defined(PLATFORM_WINDOWS)
#include <winsock.h> #include <winsock.h>
#elif defined(__FREE_BSD__) #elif defined(__FREE_BSD__)
#include <netinet/in.h> #include <netinet/in.h>

View File

@ -58,7 +58,7 @@ class JackMIDIPort : public Port {
int read (byte *buf, size_t bufsize); int read (byte *buf, size_t bufsize);
void drain (int check_interval_usecs); void drain (int check_interval_usecs);
int selectable () const { int selectable () const {
#ifdef WIN32 #ifdef PLATFORM_WINDOWS
return false; return false;
#else #else
return xthread.selectable(); return xthread.selectable();
@ -86,7 +86,7 @@ private:
RingBuffer< Evoral::Event<double> > output_fifo; RingBuffer< Evoral::Event<double> > output_fifo;
Evoral::EventRingBuffer<timestamp_t> input_fifo; Evoral::EventRingBuffer<timestamp_t> input_fifo;
Glib::Threads::Mutex output_fifo_lock; Glib::Threads::Mutex output_fifo_lock;
#ifndef WIN32 #ifndef PLATFORM_WINDOWS
CrossThreadChannel xthread; CrossThreadChannel xthread;
#endif #endif

View File

@ -27,7 +27,7 @@
#include <pthread.h> #include <pthread.h>
#include "pbd/xml++.h" #include "pbd/xml++.h"
#ifndef WIN32 #ifndef PLATFORM_WINDOWS
#include "pbd/crossthread.h" #include "pbd/crossthread.h"
#endif #endif
#include "pbd/signals.h" #include "pbd/signals.h"