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

Fixed funcs for safe use in Win32/Win64 #1806

Merged
merged 1 commit into from Aug 18, 2021
Merged

Conversation

GermanAizek
Copy link
Contributor

@GermanAizek GermanAizek commented Jun 30, 2021

  • Has this change been discussed on the forum or in an issue before?
  • Does the code follow the SFML Code Style Guide?
  • Have you provided some example/test code for your changes?
  • If you have additional steps which need to be performed list them as tasks!

Description

Easy commit for better portability between Windown platforms.

Tasks

  • Tested on Linux
  • Tested on Windows
  • Tested on macOS
  • Tested on iOS
  • Tested on Android

Copy link
Contributor Author

@GermanAizek GermanAizek left a comment

Choose a reason for hiding this comment

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

Dear @LaurentGomila and @Bromeon
Check it. Thx.

@LaurentGomila
Copy link
Member

Thanks.

You can give more details (why you changed that, and where it is documented) so that we don't have to guess.

What I found on the MSDN:

Note To write code that is compatible with both 32-bit and 64-bit versions of Windows, use GetWindowLongPtr. When compiling for 32-bit Windows, GetWindowLongPtr is defined as a call to the GetWindowLong function.

@GermanAizek
Copy link
Contributor Author

@LaurentGomila,
You have correctly found information on function, this pull request simplifies future migration between Windows platforms.
I also ask you to note that GetWindowLong will have the status of an deprecated function and possibly it will be deleted.

@GermanAizek
Copy link
Contributor Author

@eXpl0it3r, check here 5cc0c68

@eXpl0it3r
Copy link
Member

The change shouldn't really make a difference because the window styles are of type LONG i.e. 32-bits values anyways. As such it doesn't matter whether you're building for 32-bits or 64-bits architecture, you will always be dealing with 32-bits values.

But it also doesn't hurt to use the recommended function. For example .NET only ever uses the *Ptr functions.

@eXpl0it3r eXpl0it3r added this to Discussion in SFML 2.6.0 via automation Aug 10, 2021
@eXpl0it3r eXpl0it3r added this to the 2.6 milestone Aug 10, 2021
@eXpl0it3r eXpl0it3r moved this from Discussion to Review & Testing in SFML 2.6.0 Aug 10, 2021
SFML 2.6.0 automation moved this from Review & Testing to Ready Aug 17, 2021
Signed-off-by: GermanAizek <GermanAizek@yandex.ru>
@eXpl0it3r eXpl0it3r merged commit c90d308 into SFML:master Aug 18, 2021
SFML 2.6.0 automation moved this from Ready to Done Aug 18, 2021
@eXpl0it3r
Copy link
Member

Thanks for this fix! 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
SFML 2.6.0
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants