Solving DDK issues under MSYS2

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

Solving DDK issues under MSYS2

Post by shermanp »

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: 72
Joined: Wed 24 Feb, 2016 7:27 pm

Re: Solving DDK issues under MSYS2

Post by altheos »

Thanks,
it fixed compilation using MSYS2. Maybe Sarah will commit this change.
neozeed
Posts: 176
Joined: Tue 08 Jul, 2014 4:41 am
Location: Hong Kong SAR
Contact:

Re: Solving DDK issues under MSYS2

Post by neozeed »

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.
User avatar
SarahWalker
Site Admin
Posts: 2054
Joined: Thu 24 Apr, 2014 4:18 pm

Re: Solving DDK issues under MSYS2

Post by SarahWalker »

Fixed at rev 979.
Post Reply