Update Lua Bindings, fix inconsistencies.
[ardour.git] / libs / pbd / msvc / msvc_pbd.cc
index f49ac5393c85743306c0cf644ee1bcde43166a34..20065fff260215bce241f56f691311303a7720a0 100644 (file)
@@ -223,82 +223,79 @@ ssize_t ret;
        return (ret);
 }
 
+#if defined(_MSC_VER) && (_MSC_VER < 1800)
 //***************************************************************
 //
-//     round()
+//     expm1()
 //
-// Emulates round() using floor().
+// Emulates C99 expm1() using exp().
 //
 //     Returns:
 //
-//    On Success: The largest integer that is less than or
-//                equal to 'x'.
-//    On Failure: None
+//    On Success: (('e' raised to the power of 'x') - 1)
+//                (e.g. expm1(1) == 1.7182818).
+//    On Failure: None, except that calling exp(x) should generate
+//                an appropriate error for us (such as INF etc).
 //
 LIBPBD_API double PBD_APICALLTYPE
-round(double x)
+expm1(double x)
 {
-       return (floor(x));
+       return (exp(x) - (double)1.0);
 }
 
 //***************************************************************
 //
-//     trunc()
+//     log1p()
 //
-// Emulates trunc() using floor() and ceil().
+// Emulates C99 log1p() using log().
 //
 //     Returns:
 //
-//    On Success: The largest integer whose magnitude is less
-//                than or equal to 'x' (regardless of sign).
-//    On Failure: None
+//    On Success: The natural logarithm of (1 + x)
+//                (e.g. log1p(1) == 0.69314718).
+//    On Failure: None, except that calling log(x) should generate
+//                an appropriate error for us (such as ERANGE etc).
 //
 LIBPBD_API double PBD_APICALLTYPE
-trunc(double x)
+log1p(double x)
 {
-       if (x < 0)
-               return (ceil(x));
-
-       return (floor(x));
+       return (log(x + (double)1.0));
 }
 
-#if defined(_MSC_VER) && (_MSC_VER < 1800)
 //***************************************************************
 //
-//     expm1()
+//     roundf()
 //
-// Emulates C99 expm1() using exp().
+// Emulates roundf() using floorf().
 //
 //     Returns:
 //
-//    On Success: (('e' raised to the power of 'x') - 1)
-//                (e.g. expm1(1) == 1.7182818).
-//    On Failure: None, except that calling exp(x) should generate
-//                an appropriate error for us (such as INF etc).
+//    On Success: The largest integer that is less than or
+//                equal to 'x'.
+//    On Failure: None
 //
-LIBPBD_API double PBD_APICALLTYPE
-expm1(double x)
+LIBPBD_API float PBD_APICALLTYPE
+roundf(float x)
 {
-       return (exp(x) - (double)1.0);
+       return (floorf(x));
 }
 
 //***************************************************************
 //
-//     log1p()
+//     round()
 //
-// Emulates C99 log1p() using log().
+// Emulates round() using floor().
 //
 //     Returns:
 //
-//    On Success: The natural logarithm of (1 + x)
-//                (e.g. log1p(1) == 0.69314718).
-//    On Failure: None, except that calling log(x) should generate
-//                an appropriate error for us (such as ERANGE etc).
+//    On Success: The largest integer that is less than or
+//                equal to 'x'.
+//    On Failure: None
 //
 LIBPBD_API double PBD_APICALLTYPE
-log1p(double x)
+round(double x)
 {
-       return (log(x + (double)1.0));
+       return (floor(x));
 }
 #endif
 
@@ -321,6 +318,27 @@ log2(double x)
 {
        return (log(x) / log((double)2.0));
 }
+
+//***************************************************************
+//
+//     trunc()
+//
+// Emulates trunc() using floor() and ceil().
+//
+//     Returns:
+//
+//    On Success: The largest integer whose magnitude is less
+//                than or equal to 'x' (regardless of sign).
+//    On Failure: None
+//
+LIBPBD_API double PBD_APICALLTYPE
+trunc(double x)
+{
+       if (x < 0)
+               return (ceil(x));
+
+       return (floor(x));
+}
 #endif
 
 namespace PBD {