: m_context(MainContext::get_default())
, run_loop_thread (0)
, _name (str)
-#ifndef WIN32
+#ifndef PLATFORM_WINDOWS
, request_channel (true)
#endif
{
base_ui_instance = this;
-#ifndef WIN32
+#ifndef PLATFORM_WINDOWS
request_channel.ios()->connect (sigc::mem_fun (*this, &BaseUI::request_handler));
#endif
}
}
-#ifdef WIN32
+#ifdef PLATFORM_WINDOWS
gboolean
BaseUI::_request_handler (gpointer data)
{
BaseUI::signal_new_request ()
{
DEBUG_TRACE (DEBUG::EventLoop, "BaseUI::signal_new_request\n");
-#ifdef WIN32
+#ifdef PLATFORM_WINDOWS
// handled in timeout, how to signal...?
#else
request_channel.wakeup ();
BaseUI::attach_request_source ()
{
DEBUG_TRACE (DEBUG::EventLoop, "BaseUI::attach_request_source\n");
-#ifdef WIN32
+#ifdef PLATFORM_WINDOWS
GSource* request_source = g_timeout_source_new(200);
g_source_set_callback (request_source, &BaseUI::_request_handler, this, NULL);
g_source_attach (request_source, m_context->gobj());
bool
equivalent_paths (const std::string& a, const std::string& b)
{
- struct stat bA;
+ GStatBuf bA;
int const rA = g_stat (a.c_str(), &bA);
- struct stat bB;
+ GStatBuf bB;
int const rB = g_stat (b.c_str(), &bB);
return (rA == 0 && rB == 0 && bA.st_dev == bB.st_dev && bA.st_ino == bB.st_ino);
make us unwritable.
*/
- struct stat statbuf;
+ GStatBuf statbuf;
if (g_stat (p.c_str(), &statbuf) != 0) {
/* doesn't exist - not writable */
return best;
}
-#elif defined(WIN32)
+#elif defined(PLATFORM_WINDOWS)
string
mountpoint (string path)
virtual void thread_init () {};
-#ifdef WIN32
+#ifdef PLATFORM_WINDOWS
static gboolean _request_handler (gpointer);
bool request_handler ();
#else
std::string _name;
BaseUI* base_ui_instance;
-#ifndef WIN32
+#ifndef PLATFORM_WINDOWS
CrossThreadChannel request_channel;
#endif
}
template<class T> void
-RingBuffer<T>::get_read_vector (RingBuffer<T>::rw_vector *vec)
+RingBuffer<T>::get_read_vector (typename RingBuffer<T>::rw_vector *vec)
{
guint free_cnt;
}
template<class T> void
-RingBuffer<T>::get_write_vector (RingBuffer<T>::rw_vector *vec)
+RingBuffer<T>::get_write_vector (typename RingBuffer<T>::rw_vector *vec)
{
guint free_cnt;
private:
#if defined(__APPLE__)
semaphore_t _sem; // sem_t is a worthless broken mess on OSX
-#elif defined(_WIN32)
+#elif defined(PLATFORM_WINDOWS)
HANDLE _sem; // types are overrated anyway
#else
sem_t _sem;
return semaphore_timedwait(_sem, zero) == KERN_SUCCESS;
}
-#elif defined(_WIN32)
+#elif defined(PLATFORM_WINDOWS)
inline
Semaphore::Semaphore(unsigned initial)
return WaitForSingleObject(_sem, 0) == WAIT_OBJECT_0;
}
-#else /* !defined(__APPLE__) && !defined(_WIN32) */
+#else /* !defined(__APPLE__) && !defined(PLATFORM_WINDOWS) */
Semaphore::Semaphore(unsigned initial)
{
#ifndef __pbd_semutils_h__
#define __pbd_semutils_h__
-#ifdef WIN32
+#ifdef PLATFORM_WINDOWS
#include <windows.h>
#else
#include <semaphore.h>
class ProcessSemaphore {
private:
-#ifdef WIN32
+#ifdef PLATFORM_WINDOWS
HANDLE _sem;
#elif __APPLE__
ProcessSemaphore (const char* name, int val);
~ProcessSemaphore ();
-#ifdef WIN32
+#ifdef PLATFORM_WINDOWS
int signal ();
int wait ();
{
if (resource == OpenFiles)
{
-#ifdef WIN32
+#ifdef PLATFORM_WINDOWS
limit.current_limit = _getmaxstdio();
limit.max_limit = 2048;
return true;
{
if (resource == OpenFiles)
{
-#ifdef WIN32
+#ifdef PLATFORM_WINDOWS
// no soft and hard limits on windows
rlimit_t new_max = _setmaxstdio(limit.current_limit);
namespace {
-#ifdef WIN32
+#ifdef PLATFORM_WINDOWS
const char * const path_delimiter = ";";
#else
const char * const path_delimiter = ":";
ProcessSemaphore::ProcessSemaphore (const char* name, int val)
{
-#ifdef WIN32
+#ifdef PLATFORM_WINDOWS
if ((_sem = CreateSemaphore(NULL, val, 32767, name)) == NULL) {
throw failed_constructor ();
}
ProcessSemaphore::~ProcessSemaphore ()
{
-#ifdef WIN32
+#ifdef PLATFORM_WINDOWS
CloseHandle(_sem);
#elif __APPLE__
sem_close (ptr_to_sem());
#endif
}
-#ifdef WIN32
+#ifdef PLATFORM_WINDOWS
int
ProcessSemaphore::signal ()
void
FilesystemTest::testPathIsWithin ()
{
-#ifndef WIN32
+#ifndef PLATFORM_WINDOWS
system ("rm -r foo");
CPPUNIT_ASSERT (g_mkdir_with_parents ("foo/bar/baz", 0755) == 0);
PBD::SearchPath
test_search_path ()
{
-#ifdef WIN32
+#ifdef PLATFORM_WINDOWS
std::string wsp(g_win32_get_package_installation_directory_of_module(NULL));
return Glib::build_filename (wsp, "pbd_testdata");
#else
/* do the right thing if this should not return */
if (does_not_return()) {
-#ifndef WIN32
+#ifndef PLATFORM_WINDOWS
+// TODO !!!! Commented out temporarily (for Windows)
sigset_t mask;
sigemptyset (&mask);
sigsuspend (&mask);
-#endif
/*NOTREACHED*/
exit (1);
+/* JE - From what I can tell, the above code suspends
+ * program execution until (any) signal occurs. Not
+ * sure at the moment what this achieves, unless it
+ * provides some time for the user to see the message.
+ */
+#endif
}
}
#include "pbd/uuid.h"
-using namespace PBD;
-
-UUID&
-UUID::operator= (std::string const & str)
+PBD::UUID&
+PBD::UUID::operator= (std::string const & str)
{
boost::uuids::string_generator gen;
*((boost::uuids::uuid*) this) = gen (str);
}
std::string
-UUID::to_s () const
+PBD::UUID::to_s () const
{
return std::string ((const char*) data, size());
}
void
XMLTree::debug(FILE* out) const
{
+#ifdef LIBXML_DEBUG_ENABLED
xmlDocPtr doc;
XMLNodeList children;
writenode(doc, _root, doc->children, 1);
xmlDebugDumpDocument (out, doc);
xmlFreeDoc(doc);
+#endif
}
const string&