Solving DDK issues under MSYS2

Discussion of development and patch submission.
shermanp
Posts: 13
Joined: Sat 18 Feb, 2017 2:09 am

Solving DDK issues under MSYS2

Postby shermanp » Tue 10 Oct, 2017 8:03 am

Hi all.

As some may know, when attempting to compile PCem using MSYS2,

Code: Select all

cdrom-ioctl.c
will not compile due to

Code: Select all

"ddk/ntddcdrm.h"
and

Code: Select all

"ddk/ntddscsi.h"
problems.

The issue is that the DDK headers are moved and changed in Mingw-w64 compared to legacy mingw. To solve this, an #ifdef is used to determine the toolchain used. However, the current #ifdef

Code: Select all

__MINGW64__
is only valid for mingw-w64 64-bit. It is not defined when using mingw-w64 32-bit, and therefore at compile time, it tries (and fails) to use the older headers.

I propose changing the #ifdef (and #ifndef) to use

Code: Select all

__MINGW64_VERSION_MAJOR
, as that is defined for both versions of mingw-w64. This change allows the file to compile in both MSYS2, and legacy mingw.
altheos
Posts: 37
Joined: Wed 24 Feb, 2016 7:27 pm

Re: Solving DDK issues under MSYS2

Postby altheos » Mon 27 Nov, 2017 4:21 pm

Thanks,
it fixed compilation using MSYS2. Maybe Sarah will commit this change.
neozeed
Posts: 173
Joined: Tue 08 Jul, 2014 4:41 am

Re: Solving DDK issues under MSYS2

Postby neozeed » Thu 14 Dec, 2017 10:33 am

For what it's worth, I tried 'mingw-i686-7.1.0-win32-dwarf-rt_v5-rev0' and although the target is i686-w64-mingw32 the DDK headers are no longer in the ddk directory.
SarahWalker
Site Admin
Posts: 1325
Joined: Thu 24 Apr, 2014 4:18 pm

Re: Solving DDK issues under MSYS2

Postby SarahWalker » Thu 14 Dec, 2017 6:29 pm

Fixed at rev 979.

Return to “Development”

Who is online

Users browsing this forum: No registered users and 1 guest