Skip to content

Conversation

@tophyr
Copy link
Contributor

@tophyr tophyr commented Jul 13, 2024

Pull Request Type

  • GitHub Workflow changes
  • Documentation or Wiki changes
  • Build and Dependency changes
  • Runtime changes
    • Render changes
    • Audio changes
    • Input changes
    • Network changes
    • Other changes

Description

Per discussion in #459 (comment), this PR changes the way platform #define macros are set up so that we don't need to use __LINUX__ to represent any linux-ey system.

Changes were tested using unifdef to process the entire codebase at the base and tip of the branch. No differences were found after running the preprocessor with appropriate defines before and after, meaning that the compiled code is identical (as intended).

Checklist

  • I have tested my changes locally and verified that they work as intended.
  • I have documented any new or modified functionality.
  • I have reviewed the changes to ensure they do not introduce any unnecessary complexity or duplicate code.
  • I understand that by submitting this pull request, I am agreeing to license my contributions under the project's license.

Additional Comments

tophyr added 4 commits July 12, 2024 18:11
Steps:
```sh
srcs=$(mktemp)
find . -name "*.cpp" -or -name "*.c" -or -name "*.h" -or -name "*.hpp" -or -name "*.cc" -or -name "*.hh" > $srcs
xargs sed -i 's/ifndef __LINUX__/if !defined(POSIX)/' < $srcs
xargs sed -i 's/ifdef __LINUX__/if defined(POSIX)/' < $srcs
xargs sed -i 's/defined(__LINUX__)/defined(POSIX)/' < $srcs
```
@tophyr tophyr mentioned this pull request Jul 13, 2024
13 tasks
@tophyr tophyr changed the title Pr/posix defines Use POSIX instead of __LINUX__ for general OS checks Jul 13, 2024
Copy link
Member

@Lgt2x Lgt2x left a comment

Choose a reason for hiding this comment

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

I'm fine with this change, @winterheart could you please also take a look?

@winterheart
Copy link
Collaborator

Tested on Linux (SP/MP), runs fine.

@winterheart winterheart merged commit 91354d5 into DescentDevelopers:main Jul 15, 2024
@tophyr tophyr deleted the pr/posix-defines branch July 27, 2024 21:22
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