rlottie: fix windows build
authorsub.mohanty@samsung.com <smohantty@gmail.com>
Sat, 29 Jun 2019 11:27:09 +0000 (20:27 +0900)
committerHermet Park <hermetpark@gmail.com>
Wed, 10 Jul 2019 01:56:09 +0000 (10:56 +0900)
src/vector/vimageloader.cpp
src/vector/vline.h
src/vector/vpath.cpp

index 2462d97..b91554b 100644 (file)
@@ -1,7 +1,7 @@
 #include "vimageloader.h"
 #include "config.h"
 #include "vdebug.h"
-#ifndef WIN32
+#ifndef _WIN32
 #include <dlfcn.h>
 #else
 #include <windows.h>
@@ -36,7 +36,7 @@ struct VImageLoader::Impl {
     lottie_image_load_data_f imageFromData{nullptr};
 
 #if LOTTIE_IMAGE_MODULE_SUPPORT
-#ifdef WIN32
+#ifdef _WIN32
     HMODULE dl_handle{nullptr};
     bool    moduleLoad()
     {
index f466e31..f80d321 100644 (file)
@@ -51,10 +51,11 @@ private:
 
 inline float VLine::angle() const
 {
+    static constexpr float K_PI = 3.141592f;
     const float dx = mX2 - mX1;
     const float dy = mY2 - mY1;
 
-    const float theta = std::atan2(dy, dx) * 180.0 / M_PI;
+    const float theta = std::atan2f(dy, dx) * 180.0f / K_PI;
     return theta;
 }
 
index a82cbdf..220b05e 100644 (file)
@@ -144,7 +144,7 @@ void VPath::VPathData::reserve(size_t pts, size_t elms)
 
 static VPointF curvesForArc(const VRectF &, float, float, VPointF *, size_t *);
 static constexpr float PATH_KAPPA = 0.5522847498f;
-static constexpr float K_PI = float(M_PI);
+static constexpr float K_PI = 3.141592f;
 
 void VPath::VPathData::arcTo(const VRectF &rect, float startAngle,
                              float sweepLength, bool forceMoveTo)