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

darwin/Platform.c: do not include non-existing headers which break build #1381

Merged
merged 1 commit into from
Feb 4, 2024

Conversation

barracuda156
Copy link
Contributor

Commit ed7eac5 unconditionally includes a header which is not present on earlier macOS. This unnecessarily breaks the build. Use includes correctly.

@barracuda156
Copy link
Contributor Author

Everything looks good now:
htop_ppc

@BenBE BenBE added bug 🐛 Something isn't working MacOS 🍏 MacOS / Darwin related issues labels Jan 18, 2024
@BenBE BenBE added this to the 3.4.0 milestone Jan 18, 2024
darwin/Platform.h Outdated Show resolved Hide resolved
darwin/Platform.c Outdated Show resolved Hide resolved
@barracuda156
Copy link
Contributor Author

@BenBE Thank you, I have dropped AvailabilityMacros header from Platform.h now, the fallback now is in Platform.c.

(Perhaps there is little point to make a specific check here, we know that prior to 10.9 there is no folder for types in /usr/include/sys, SDKs are public, and the files are specifically for Darwin, no surprises here.)

@Explorer09
Copy link
Contributor

@barracuda156 htop coding style prefers not to have a version number check in order to determine whether a header is available. You may mention the version number in code comments, but we would like the header availability be checked in configure.ac instead.

@barracuda156 barracuda156 marked this pull request as draft January 19, 2024 17:35
@barracuda156
Copy link
Contributor Author

@Explorer09 Ok, let me make recommended changes, confirm that such solution will actually work and then rebase the PR.

@barracuda156 barracuda156 marked this pull request as ready for review January 28, 2024 11:25
@barracuda156
Copy link
Contributor Author

@Explorer09 Could you please review?

darwin/Platform.c Outdated Show resolved Hide resolved
darwin/Platform.c Outdated Show resolved Hide resolved
Unbreak builds on macOS versions where _mach_port_t.h does not exist.
mach/port.h exists on every macOS and has needed defines.
@barracuda156
Copy link
Contributor Author

@Explorer09 @BenBE I have switched to a simpler version which just replaces the included header with the universally supported one, as suggested by @ryandesign above.

@BenBE BenBE merged commit 541c17c into htop-dev:main Feb 4, 2024
12 checks passed
@barracuda156 barracuda156 deleted the unbreak_macos branch February 4, 2024 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working MacOS 🍏 MacOS / Darwin related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants