Skip to content

Commit

Permalink
Fixed fmin/fmax CRT library name collision.
Browse files Browse the repository at this point in the history
  • Loading branch information
bkaradzic committed Nov 18, 2013
1 parent 82194c5 commit a4df646
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/14-shadowvolumes/shadowvolumes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1822,7 +1822,7 @@ void createNearClipVolume(float* __restrict _outPlanes24f
bool clipTest(const float* _planes, uint8_t _planeNum, const Mesh& _mesh, const float* _scale, const float* _translate)
{
float (*volumePlanes)[4] = (float(*)[4])_planes;
float scale = fmax(fmax(_scale[0], _scale[1]), _scale[2]);
float scale = fmaxf(fmaxf(_scale[0], _scale[1]), _scale[2]);

const GroupArray& groups = _mesh.m_groups;
for (GroupArray::const_iterator it = groups.begin(), itEnd = groups.end(); it != itEnd; ++it)
Expand Down
8 changes: 5 additions & 3 deletions examples/common/fpumath.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,21 @@
#include <math.h>
#include <string.h>

inline float fmin(float _a, float _b)
#if BX_COMPILER_MSVC
inline float fminf(float _a, float _b)
{
return _a < _b ? _a : _b;
}

inline float fmax(float _a, float _b)
inline float fmaxf(float _a, float _b)
{
return _a > _b ? _a : _b;
}
#endif // BX_COMPILER_MSVC

inline float fclamp(float _a, float _min, float _max)
{
return fmin(fmax(_a, _min), _max);
return fminf(fmaxf(_a, _min), _max);
}

inline float fsaturate(float _a)
Expand Down

0 comments on commit a4df646

Please sign in to comment.