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

Defines are still needed for FMT_MODULE as well #4027

Merged
merged 1 commit into from
Jun 24, 2024

Conversation

matt77hias
Copy link
Contributor

@matt77hias matt77hias commented Jun 18, 2024

The alternative is duplicating these in fmt.cc.

Copy link
Contributor

@vitaut vitaut left a comment

Choose a reason for hiding this comment

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

Thanks for the fix! LGTM, just one minor comment inline.

src/os.cc Outdated
Comment on lines 41 to 42
#if FMT_USE_FCNTL
# ifdef _WIN32
Copy link
Contributor

Choose a reason for hiding this comment

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

We can merge these two now to reduce nesting:

#if FMT_USE_FCNTL && defined(_WIN32)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to #if defined(FMT_USE_FCNTL) && defined(_WIN32) (see below)

src/os.cc Outdated
Comment on lines 41 to 42
#if FMT_USE_FCNTL
# ifdef _WIN32
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
#if FMT_USE_FCNTL
# ifdef _WIN32
#if defined(FMT_USE_FCNTL) && defined(_WIN32)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct it would be needed for FMT_USE_FCNTL == 0 and FMT_USE_FCNTL == 1 due to

constexpr mode_t default_open_mode =
    S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks redundant now, let's just remove the FMT_USE_FCNTL check here.

@vitaut vitaut merged commit bbf44cc into fmtlib:master Jun 24, 2024
43 checks passed
@vitaut
Copy link
Contributor

vitaut commented Jun 24, 2024

Merged, thanks!

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.

None yet

3 participants