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

Split platform specific code to its own file #21368

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Chocobo1
Copy link
Member

No description provided.

@Chocobo1 Chocobo1 added the Code cleanup Clean up the code while preserving the same outcome label Sep 20, 2024
@Chocobo1 Chocobo1 added this to the 5.1 milestone Sep 20, 2024
src/base/utils/randomlayer_linux.cpp Dismissed Show dismissed Hide dismissed
#include <cstring>
#include <sys/random.h>
#if defined(Q_OS_LINUX)
#include "randomlayer_linux.cpp"
Copy link
Member

@glassez glassez Sep 20, 2024

Choose a reason for hiding this comment

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

I would still use .h extension for these files.
Nevermind. I'm not sure.

Copy link
Member Author

Choose a reason for hiding this comment

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

But they have different private fields and the header will become 'dirty' if all platform specific code are in there.

Copy link
Member

Choose a reason for hiding this comment

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

I mean "randomlayer_linux.h" etc.
But it looks strange because of unnamed namespace there.

Copy link
Member Author

Choose a reason for hiding this comment

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

I mean "randomlayer_linux.h" etc.

Then the header will contain implementations which we previously keep it in .cpp files.
It seems to me, doing it other way will not be as clean as the current.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code cleanup Clean up the code while preserving the same outcome
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants