Skip to content

Conversation

@natoscott
Copy link
Member

Related: #1828

Move the static_assert definition into a new Debug.h header
so that the remaining filesystem-related parts can be moved
somewhere platform-specific.
Move the readfile and readfileat routines into Compat.[ch]
so that they can be moved to a platform-specific location.
Transition Compat.[ch] into the Linux platform directory.
Linux is the only platform using this code after several
years now so best if its not compiled into all the other
platforms htop binary.  However, this change is primarily
intended to assist with the iOS port.

Related: htop-dev#1828
Copy link
Member

@BenBE BenBE left a comment

Choose a reason for hiding this comment

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

LGTM.

#define HEADER_Debug
/*
htop - Debug.h
(C) 2020 htop dev team
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
(C) 2020 htop dev team
(C) 2025 htop dev team

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 didn't change any code here, so ended up just leaving the same copyright notice as the original file.

@Explorer09
Copy link
Contributor

There is only one place that uses static_assert? This makes me wonder if we still need this macro anymore, or whether we need a new policy regarding the use of static_assert.

I have no objection to this PR; just point out something that's worth discussing in the future. (In #1829 I have removed that only static_assert use.)

@natoscott natoscott merged commit 6cf1097 into htop-dev:main Dec 4, 2025
20 checks passed
@natoscott natoscott deleted the compat-refactor branch December 4, 2025 05:46
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.

3 participants