summaryrefslogtreecommitdiff
path: root/libs/pbd
diff options
context:
space:
mode:
Diffstat (limited to 'libs/pbd')
-rw-r--r--libs/pbd/msvc/msvc_pbd.cc19
-rw-r--r--libs/pbd/pbd/msvc_pbd.h1
-rw-r--r--libs/pbd/pbd/semaphore.h3
3 files changed, 23 insertions, 0 deletions
diff --git a/libs/pbd/msvc/msvc_pbd.cc b/libs/pbd/msvc/msvc_pbd.cc
index 45137da0f3..f6efe9cdad 100644
--- a/libs/pbd/msvc/msvc_pbd.cc
+++ b/libs/pbd/msvc/msvc_pbd.cc
@@ -29,6 +29,7 @@ CreateHardLinkA( LPCSTR lpFileName,
#include <algorithm>
#include <string>
#include <io.h>
+#include <math.h>
#include <fcntl.h>
#include <errno.h>
#include <stdlib.h>
@@ -222,6 +223,24 @@ ssize_t ret;
return (ret);
}
+//***************************************************************
+//
+// round()
+//
+// Emulates round() using floor().
+//
+// Returns:
+//
+// On Success: The largest integer that is less than or
+// equal to 'x'.
+// On Failure: None
+//
+PBD_API double PBD_APICALLTYPE
+round(double x)
+{
+ return (floor(x));
+}
+
namespace PBD {
//***************************************************************
diff --git a/libs/pbd/pbd/msvc_pbd.h b/libs/pbd/pbd/msvc_pbd.h
index 8d157731bd..736095d9e8 100644
--- a/libs/pbd/pbd/msvc_pbd.h
+++ b/libs/pbd/pbd/msvc_pbd.h
@@ -220,6 +220,7 @@ PBD_API int PBD_APICALLTYPE gettimeofday(struct timeval *__restrict tv, __tim
PBD_API ssize_t PBD_APICALLTYPE pread(int handle, void *buf, size_t nbytes, off_t offset);
PBD_API ssize_t PBD_APICALLTYPE pwrite(int handle, const void *buf, size_t nbytes, off_t offset);
PBD_API int PBD_APICALLTYPE poll(struct pollfd *fds, nfds_t nfds, int timeout);
+PBD_API double PBD_APICALLTYPE round(double x);
namespace PBD {
diff --git a/libs/pbd/pbd/semaphore.h b/libs/pbd/pbd/semaphore.h
index 5f0a2df2c0..caa5eb68c2 100644
--- a/libs/pbd/pbd/semaphore.h
+++ b/libs/pbd/pbd/semaphore.h
@@ -24,6 +24,9 @@
# include <mach/mach.h>
#elif defined(PLATFORM_WINDOWS)
# include <windows.h>
+#ifndef INFINITE
+#define INFINITE 0xffffffffL
+#endif
#else
# include <semaphore.h>
# include <errno.h>