-
Notifications
You must be signed in to change notification settings - Fork 415
set of windows (mingw64) build fixes #3090
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,9 @@ | |
#ifndef NO_GRAPHICS | ||
|
||
#include <cstdio> | ||
#ifdef _WIN32 | ||
#define _USE_MATH_DEFINES // ensure (non-standard) value of M_PI is brought in from math.h | ||
#endif | ||
Comment on lines
+7
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. C++20 has added std::numbers::pi (double) and std::numbers::pi_v which should fix this problem and would be cleaner. I'm not sure if ezgl is compiled with C++20 but it can definitely be used here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have no objection to compiling ezgl with C++20. The UG machines at U of T use g++12.2, and all g++ C++20 support was in by g++ version 11. Using std::numbers::pi is fine with me. |
||
#include <cmath> | ||
#include <algorithm> | ||
#include <sstream> | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
libezgl doesn't actually belong to this repository and is a subtree here. The actual repo for it is here:
https://github.com/verilog-to-routing/ezgl
However, we're going to sync up the two repositories really soon so I think it's okay to do the change here. @AlexandreSinger thoughts?
Also if ezgl is compiled with C++20, see below on a way to avoid doing ifdefs.
EDIT: Just checked and it's C++14.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this PR can come in before we change this to a sub-module it should be fine (we can include it with the other changes that need to be brought in); if not, @w0lek would need to raise a PR on the EZGL repo (which we will immediately accept).
I think EZGL is kept on C++14 to ensure that it builds on the school computers for the coarse it is used in (but thats just a guess). C++20 is still technically experimental and some of the features confuse students, so we keep them on C++14 if I recall correctly. I see no issue with this fix for now.