Skip to content

Commit

Permalink
fix msvc build
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangjipeng committed Feb 12, 2025
1 parent e540995 commit 5302929
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/gfx/gfx_gradient_adapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class gradient_radial
void init(scalar, scalar, scalar) { }
static int32_t calculate(int32_t x, int32_t y, int32_t d)
{
return (int)Sqrt(x * x + y * y);
return (int32_t)SqrtD(x * x + y * y);
}
};

Expand Down
1 change: 1 addition & 0 deletions src/include/math_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ typedef float scalar;
#define Exp(x) expf(x)
#define Pow(x, y) powf((x), (y))

#define SqrtD(x) sqrt(x)
// max min
template <typename T> inline T Min(T a, T b) { return (a < b) ? a : b; }
template <typename T> inline T Max(T a, T b) { return (a > b) ? a : b; }
Expand Down
1 change: 1 addition & 0 deletions tools/code_format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
astyle --options=code_style.ini --recursive "../src/*.cpp,*.c,*.h"
astyle --options=code_style.ini --recursive "../ext/*.cpp,*.c,*.h"
astyle --options=code_style.ini --recursive "../include/*.h"
astyle --options=code_style.ini --recursive "../unit_tests/*.cpp,*.h"

0 comments on commit 5302929

Please sign in to comment.