Skip to content
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

Reduce library requirement from C++17 to C++11 #32

Merged
merged 8 commits into from
Apr 10, 2023
Merged

Reduce library requirement from C++17 to C++11 #32

merged 8 commits into from
Apr 10, 2023

Conversation

facug91
Copy link
Contributor

@facug91 facug91 commented Apr 8, 2023

Solve #31
I made some decisions that maybe you think would be better otherwise. If so, tell me and I'll change it.
For the record, I've only tried it on Linux, but I've also modified the apple and windows code.

@facug91
Copy link
Contributor Author

facug91 commented Apr 8, 2023

I don't know how to solve the MacOS problem, I don't have one to try out. I guess that if a use something like reinterpret_cast<void *>(os_name.data()), it might work, but I'm not sure.

@lfreist
Copy link
Owner

lfreist commented Apr 8, 2023

Thanks. Right now, I don't have access to MacOS as well but I'll take care of it.

@lfreist
Copy link
Owner

lfreist commented Apr 8, 2023

I guess that if a use something like reinterpret_cast<void *>(os_name.data()), it might work, but I'm not sure.

I am not sure how this results in the produced error but this should be done anyways:

It makes no sense to call sizeof(std::string). What we want is the size of the underlying char array and not the size of the std::string object.

Either try size = std::string::size() or since I hard coded the size, just use size = 1024.

If this won't work, i would recommend not to use std::string here but simply a raw char array and then construct a std::string using the char pointer and its size modified by the sysctl function when returning the result.

I can also give these approaches a try at the start of the coming week if you want.

@facug91
Copy link
Contributor Author

facug91 commented Apr 10, 2023

I apologize for the clang formatting errors. I have Ubuntu 20 on my machine and I couldn't install clang-format-14. After a few tries, I ended up using an Ubuntu 22 Docker container and was able to fix the issues.
I still can't test if the Apple and Windows implementations work, but at least they are compiling fine.

@facug91
Copy link
Contributor Author

facug91 commented Apr 10, 2023

I think it might be beneficial to add a new job to the CI to run Example. That way, one could see the library running, and the output it generates.

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.

2 participants