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

tweak(compiler/linux): build portability #2898

Conversation

tens0rfl0w
Copy link
Contributor

Goal of this PR

On some systems (like Ubuntu) netinet headers get included by default. In those cases, we are re-defining system macros without undefining them first, which makes building fail.

This fixes building on native Ubuntu, so this should revive Github Runners once again.
https://github.com/tens0rfl0w/fivem/actions/runs/11621071896/job/32364102250

How is this PR achieving the goal

  • Guarding _GNU_SOURCE macro
  • Undefining __bswap_* macros before re-defining them

This PR applies to the following area(s)

Source compiling (Linux)

Successfully tested on

Game builds: Not applicable

Platforms: Linux (Github Runners - ubuntu-20.04)

Checklist

  • Code compiles and has been tested successfully.
  • Code explains itself well and/or is documented.
  • My commit message explains what the changes do and what they are for.
  • No extra compilation warnings are added by these changes.

Fixes issues

/

On some systems, this is already defined by default or via compiler-options, re-defining there is unwanted.
On some systems (like Ubuntu) netinet headers get included by default. In those cases, we are re-defining system macros without undefining them first, which makes building fail.
@github-actions github-actions bot added the invalid Requires changes before it's considered valid and can be (re)triaged label Oct 31, 2024
@prikolium-cfx prikolium-cfx added ready-to-merge This PR is enqueued for merging and removed invalid Requires changes before it's considered valid and can be (re)triaged labels Nov 5, 2024
@prikolium-cfx
Copy link
Collaborator

Thanks for your contribution. Let's try :-)

@prikolium-cfx prikolium-cfx merged commit f4eedfc into citizenfx:master Nov 13, 2024
2 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge This PR is enqueued for merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants