(re3) Fix compiler errors related to MinGW #1262

Open
alextwothousand wants to merge 7 commits from alextwothousand/master into master
alextwothousand commented 3 years ago (Migrated from github.com)
  • pragma comment is not supported with the mingw / msys2 compiler toolchain. I have mitigated this by adding a mingw compiler check in src/CMakeLists.txt
  • You cannot cast from a HKL (HANDLE, PVOID) to a DWORD. I have mitigated this by casting to a uintptr first, then casting to a DWORD.
* pragma comment is not supported with the mingw / msys2 compiler toolchain. I have mitigated this by adding a mingw compiler check in src/CMakeLists.txt * You cannot cast from a HKL (HANDLE, PVOID) to a DWORD. I have mitigated this by casting to a uintptr first, then casting to a DWORD.
erorcun commented 3 years ago (Migrated from github.com)

now it compiles on MinGW? :o

now it compiles on MinGW? :o
withmorten commented 3 years ago (Migrated from github.com)

Perhaps casting to DWORD_PTR is better, since that's essentially the same?

Perhaps casting to DWORD_PTR is better, since that's essentially the same?
madebr (Migrated from github.com) reviewed 3 years ago
madebr (Migrated from github.com) commented 3 years ago

I'm surprised MSVC doesn't need this.
What missing symbol is the linker complaining about?
If MSVC also needs, the library can be moved to a if(WIN32) branch.

I'm surprised MSVC doesn't need this. What missing symbol is the linker complaining about? If MSVC also needs, the library can be moved to a `if(WIN32)` branch.
madebr (Migrated from github.com) reviewed 3 years ago
madebr (Migrated from github.com) commented 3 years ago

Or is this using the msys2 compiler of msys2?

msys2 has (more then) 3 platforms: MSYS2, MINGW32 and MINGW64 (value of the MPLATFORM environment variable)

  • msys2 is a kind of unix on Windows
  • mingw32 is pure 32-bit windows
  • mingw64 is pure 64-bit windows
Or is this using the msys2 compiler of msys2? msys2 has (more then) 3 platforms: MSYS2, MINGW32 and MINGW64 (value of the `MPLATFORM` environment variable) - msys2 is a kind of unix on Windows - mingw32 is pure 32-bit windows - mingw64 is pure 64-bit windows
alextwothousand commented 3 years ago (Migrated from github.com)

now it compiles on MinGW? :o

always did, haha.

> > > now it compiles on MinGW? :o always did, haha.
alextwothousand commented 3 years ago (Migrated from github.com)

Perhaps casting to DWORD_PTR is better, since that's essentially the same?

did actually try that. game wouldn't load, but I think it was for a unrelated issue. will test it again now and let you know how it goes.

> > > Perhaps casting to DWORD_PTR is better, since that's essentially the same? did actually try that. game wouldn't load, but I think it was for a unrelated issue. will test it again now and let you know how it goes.
alextwothousand (Migrated from github.com) reviewed 3 years ago
alextwothousand (Migrated from github.com) commented 3 years ago

MSVC does need winmm. It still has access to it, I changed #if _WIN32 to #if _MSC_VER.
I am using msys2 / mingw64.

If there is a if(WIN32) branch, I will likely move it there instead.

MSVC does need winmm. It still has access to it, I changed `#if _WIN32` to `#if _MSC_VER`. I am using msys2 / mingw64. If there is a `if(WIN32)` branch, I will likely move it there instead.
alextwothousand (Migrated from github.com) reviewed 3 years ago
alextwothousand (Migrated from github.com) commented 3 years ago

I just looked into src/CMakeLists.txt. There is no if(WIN32) branch at all. Only a check for GNU / Clang OR MSVC compilers - which our situation does not match either.

I just looked into `src/CMakeLists.txt`. There is no `if(WIN32)` branch at all. Only a check for GNU / Clang OR MSVC compilers - which our situation does not match either.
alextwothousand commented 3 years ago (Migrated from github.com)

I've made a few corrections.

I've made a few corrections.
madebr (Migrated from github.com) reviewed 3 years ago
madebr (Migrated from github.com) commented 3 years ago

Thanks!

Thanks!
madebr (Migrated from github.com) reviewed 3 years ago
madebr (Migrated from github.com) commented 3 years ago

This syntax is also used in src/audio/oal/stream.cpp.

#if defined _MSC_VER && !defined CMAKE_NO_AUTOLINK
This syntax is also used in `src/audio/oal/stream.cpp`. ```suggestion #if defined _MSC_VER && !defined CMAKE_NO_AUTOLINK ```
alextwothousand (Migrated from github.com) reviewed 3 years ago
alextwothousand (Migrated from github.com) commented 3 years ago

Grazie grazie.

Grazie grazie.
erorcun commented 3 years ago (Migrated from github.com)

I appreciate your fix for X11, but I want to do this by checking if environment has X11 (see https://github.com/GTAmodding/re3/issues/1180), and otherwise disable GET_KEYBOARD_INPUT_FROM_X11. if you remove that part, I can merge these 2 PRs immediately.

I appreciate your fix for X11, but I want to do this by checking if environment has X11 (see https://github.com/GTAmodding/re3/issues/1180), and otherwise disable GET_KEYBOARD_INPUT_FROM_X11. if you remove that part, I can merge these 2 PRs immediately.
This repo is archived. You cannot comment on pull requests.
Loading…
There is no content yet.