-
Notifications
You must be signed in to change notification settings - Fork 11
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
Added CMakeLists.txt and fixed C++17 compilation on Windows #10
base: master
Are you sure you want to change the base?
Conversation
prometey1982
commented
Jan 2, 2025
- Removed unused headers
- Added CMakeLists.txt for including into projects with CMake
- Fixed compilation for modern C++
@bfoz can look into? |
#include "intelhex.h" | ||
|
||
#include <fstream> |
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.
I prefer to order includes with system (or std) includes before local includes
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.
In such case you can get into situation when .h file uses something from implementation but not includes it.
@@ -350,7 +348,7 @@ namespace intelhex | |||
|
|||
while( (s.get() == ':') && s.good() ) | |||
{ | |||
getline(s, line); // Read the whole line | |||
std::getline(s, line); // Read the whole line |
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.
Was this causing a compile error?
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.
getline
is inside std namespace
https://en.cppreference.com/w/cpp/string/basic_string/getline
Sorry for the delay. I don't use CMake, so I have no way of validating that part, or any way of maintaining it. Does CMake have a backwards-compatibility mode for using Makefiles? The header changes look simple enough. Are those changes Windows-specific? Which parts are C++17 specific? |
I think that previously getline was not inside std namespace or something like this. Maybe there was some macros. When I took your library for my purposes I found that it has some Linux specific includes and doesn't compile with Visual Studio C++ 2022 with enabled C++17. This is way I named this PR as fix for C++17 on Windows. |