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

Removed compiler specific directives #68

Merged
merged 7 commits into from
Jun 23, 2022

Conversation

IkerGalardi
Copy link
Contributor

@IkerGalardi IkerGalardi commented Jun 22, 2022

PR to get closer to a working linux port (issue #66)

Removed compiler specific directives like __debugbreak() and __declspec in order to be more portable. Other systems like GNU/Linux don't support those intrinsics, so they need to be replaced.

Checking if __GNUC__ is defined we can detect if gcc is being used

Status of PR:

  • Replace __declspec with GNU/Linux directives.
  • Replace __pragma(optimize) with GNU/Linux directives
  • Replace __pragma(warning) with GNU/Linux directives
  • Detect clang compiler usage (and use clang specific directives)

GCC and CLANG seem to work differently as to what MSVC does, as they mostly work by pushing the current state, changing the state for a brief period, and then changing it back to what it was. This should not be a problem as I've seen the pattern DISABLE_WHATEVER do things ENABLE_WHATEVER in the engine, but is something to think about in the future.

@IkerGalardi IkerGalardi marked this pull request as ready for review June 22, 2022 18:10
GCC directives are not documented inside clang so it seems that they
would not work. A warning is thrown with #pragma warn in order to advise
the user.
@PanosK92 PanosK92 merged commit 8516635 into PanosK92:master Jun 23, 2022
@PanosK92
Copy link
Owner

Thank you

@IkerGalardi IkerGalardi deleted the compiler-intrinsics branch June 27, 2022 16:30
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

2 participants