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

View File

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

View File

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

View File

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

View File

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