MSVC waf-build specific fixes

* Dodge ardourext/pthread.h when WAF_BUILD is defined
* add io.h for POSIX style read/close
* define timeval
This commit is contained in:
EZ4Stephen 2025-12-11 12:56:45 +04:00 committed by Robin Gareus
parent fb9be868f5
commit 783202d3ad
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
7 changed files with 23 additions and 3 deletions

View file

@ -36,7 +36,11 @@
#include "pbd/cpus.h"
#if defined(COMPILER_MSVC) && !defined(__PTW32_VERSION)
#ifndef WAF_BUILD
#include <ardourext/pthread.h> // Gets us '__PTW32_VERSION'
#else
#include <pthread.h>
#endif
#endif
int32_t

View file

@ -38,6 +38,10 @@
#include "pbd/pthread_utils.h"
#include "pbd/progress.h"
#ifdef COMPILER_MSVC
#include <io.h> // For read, close
#endif
using namespace PBD;
static size_t

View file

@ -59,8 +59,9 @@
/* close(), read(), write() */
#ifdef COMPILER_MSVC
#include <io.h> // Microsoft's nearest equivalent to <unistd.h>
#ifndef WAF_BUILD
#include <ardourext/misc.h>
#else
#endif
#endif
#include "pbd/compose.h"

View file

@ -30,7 +30,7 @@
#include "pbd/timing.h"
/* check for __PTW32_VERSION */
#ifdef COMPILER_MSVC
#if defined (COMPILER_MSVC) && !defined (WAF_BUILD)
#include <ardourext/pthread.h>
#else
#include <pthread.h>

View file

@ -36,7 +36,7 @@
#endif /* __PTW32_VERSION */
#endif /* PTHREAD_MACROS_DEFINED */
#ifdef COMPILER_MSVC
#if defined (COMPILER_MSVC) && !defined (WAF_BUILD)
#include <ardourext/pthread.h>
#else
#include <pthread.h>

View file

@ -31,6 +31,10 @@
# define DEBUG_STACK_ALLOC(...)
#endif
#ifdef COMPILER_MSVC
#undef max
#endif
namespace PBD {
template <class T, std::size_t stack_capacity>

View file

@ -32,7 +32,14 @@
#ifndef COMPILER_MSVC
#include <sys/time.h>
#else
#ifndef WAF_BUILD
#include <ardourext/misc.h>
#else
struct timeval {
long tv_sec;
long tv_usec;
};
#endif
#endif
#include "pbd/command.h"