summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libs/pbd/msvc/msvc_pbd.cc18
-rw-r--r--libs/pbd/pbd/msvc_pbd.h1
-rw-r--r--msvc_extra_headers/ardourext/misc.h.input1
3 files changed, 20 insertions, 0 deletions
diff --git a/libs/pbd/msvc/msvc_pbd.cc b/libs/pbd/msvc/msvc_pbd.cc
index f49ac5393c..68596e3463 100644
--- a/libs/pbd/msvc/msvc_pbd.cc
+++ b/libs/pbd/msvc/msvc_pbd.cc
@@ -225,6 +225,24 @@ ssize_t ret;
//***************************************************************
//
+// roundf()
+//
+// Emulates roundf() using floorf().
+//
+// Returns:
+//
+// On Success: The largest integer that is less than or
+// equal to 'x'.
+// On Failure: None
+//
+LIBPBD_API float PBD_APICALLTYPE
+roundf(float x)
+{
+ return (floorf(x));
+}
+
+//***************************************************************
+//
// round()
//
// Emulates round() using floor().
diff --git a/libs/pbd/pbd/msvc_pbd.h b/libs/pbd/pbd/msvc_pbd.h
index 5a6b550242..1a017fcb8a 100644
--- a/libs/pbd/pbd/msvc_pbd.h
+++ b/libs/pbd/pbd/msvc_pbd.h
@@ -230,6 +230,7 @@ LIBPBD_API int __cdecl gettimeofday(struct timeval *__restrict tv, __
LIBPBD_API ssize_t PBD_APICALLTYPE pread(int handle, void *buf, size_t nbytes, off_t offset);
LIBPBD_API ssize_t PBD_APICALLTYPE pwrite(int handle, const void *buf, size_t nbytes, off_t offset);
LIBPBD_API int PBD_APICALLTYPE poll(struct pollfd *fds, nfds_t nfds, int timeout);
+LIBPBD_API float PBD_APICALLTYPE roundf(float x);
LIBPBD_API double PBD_APICALLTYPE round(double x);
LIBPBD_API double PBD_APICALLTYPE trunc(double x);
diff --git a/msvc_extra_headers/ardourext/misc.h.input b/msvc_extra_headers/ardourext/misc.h.input
index 11ba638494..6b6533b510 100644
--- a/msvc_extra_headers/ardourext/misc.h.input
+++ b/msvc_extra_headers/ardourext/misc.h.input
@@ -253,6 +253,7 @@ inline int64_t abs(int64_t val) throw()
#if !defined(LIBPBD_API) || defined(PBD_IS_IN_WIN_STATIC_LIB)
extern double round(double x);
+extern float roundf(float x);
// Emulate some C99 math functions which MSVC itself didn't
// implement until later in life.