Skip to content

Added min function & Updated platform toolset for Visual Studio 2019 - #7

Open
panda668 wants to merge 1 commit into
bspruck:masterfrom
panda668:master
Open

Added min function & Updated platform toolset for Visual Studio 2019#7
panda668 wants to merge 1 commit into
bspruck:masterfrom
panda668:master

Conversation

@panda668

Copy link
Copy Markdown

Added min function
Updated platform toolset for visual studio 2019


// Function members

#define min(x,y) x>y?y:x

@LordKraken LordKraken May 26, 2019

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add parenthesis: #define min(x,y) ((x)>(y)?(y):(x))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

edit: what about just replacing min with __min, that's the one from windows stdlib apparently.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would even go for:
#define min(x,y) ((x)>(y)?y:x)
And: No Compiler/platform dependency if not needed.

@LordKraken LordKraken left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing the min issue but changing the platform toolset forces us to upgrade to VS 2019.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants