diff --git a/libs/pbd/cpus.cc b/libs/pbd/cpus.cc index 1f7e8529aa..89ad0f73b2 100644 --- a/libs/pbd/cpus.cc +++ b/libs/pbd/cpus.cc @@ -36,7 +36,11 @@ #include "pbd/cpus.h" #if defined(COMPILER_MSVC) && !defined(__PTW32_VERSION) +#ifndef WAF_BUILD #include // Gets us '__PTW32_VERSION' +#else +#include +#endif #endif int32_t diff --git a/libs/pbd/file_archive.cc b/libs/pbd/file_archive.cc index f26c7a26f1..54648089d4 100644 --- a/libs/pbd/file_archive.cc +++ b/libs/pbd/file_archive.cc @@ -38,6 +38,10 @@ #include "pbd/pthread_utils.h" #include "pbd/progress.h" +#ifdef COMPILER_MSVC +#include // For read, close +#endif + using namespace PBD; static size_t diff --git a/libs/pbd/file_utils.cc b/libs/pbd/file_utils.cc index 232c29486f..c091e5beb9 100644 --- a/libs/pbd/file_utils.cc +++ b/libs/pbd/file_utils.cc @@ -59,8 +59,9 @@ /* close(), read(), write() */ #ifdef COMPILER_MSVC #include // Microsoft's nearest equivalent to +#ifndef WAF_BUILD #include -#else +#endif #endif #include "pbd/compose.h" diff --git a/libs/pbd/pbd/debug.h b/libs/pbd/pbd/debug.h index de8058c5cd..f337323af2 100644 --- a/libs/pbd/pbd/debug.h +++ b/libs/pbd/pbd/debug.h @@ -30,7 +30,7 @@ #include "pbd/timing.h" /* check for __PTW32_VERSION */ -#ifdef COMPILER_MSVC +#if defined (COMPILER_MSVC) && !defined (WAF_BUILD) #include #else #include diff --git a/libs/pbd/pbd/pthread_utils.h b/libs/pbd/pbd/pthread_utils.h index cb9d8759fe..de2f311d72 100644 --- a/libs/pbd/pbd/pthread_utils.h +++ b/libs/pbd/pbd/pthread_utils.h @@ -36,7 +36,7 @@ #endif /* __PTW32_VERSION */ #endif /* PTHREAD_MACROS_DEFINED */ -#ifdef COMPILER_MSVC +#if defined (COMPILER_MSVC) && !defined (WAF_BUILD) #include #else #include diff --git a/libs/pbd/pbd/stack_allocator.h b/libs/pbd/pbd/stack_allocator.h index b5a907711b..859f244445 100644 --- a/libs/pbd/pbd/stack_allocator.h +++ b/libs/pbd/pbd/stack_allocator.h @@ -31,6 +31,10 @@ # define DEBUG_STACK_ALLOC(...) #endif +#ifdef COMPILER_MSVC +#undef max +#endif + namespace PBD { template diff --git a/libs/pbd/pbd/undo.h b/libs/pbd/pbd/undo.h index 5d93d451ac..d91a284165 100644 --- a/libs/pbd/pbd/undo.h +++ b/libs/pbd/pbd/undo.h @@ -32,7 +32,14 @@ #ifndef COMPILER_MSVC #include #else +#ifndef WAF_BUILD #include +#else +struct timeval { + long tv_sec; + long tv_usec; +}; +#endif #endif #include "pbd/command.h"