Page 1 of 1

Solving DDK issues under MSYS2

Posted: Tue 10 Oct, 2017 8:03 am
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.

Re: Solving DDK issues under MSYS2

Posted: Mon 27 Nov, 2017 4:21 pm
by altheos
Thanks,
it fixed compilation using MSYS2. Maybe Sarah will commit this change.

Re: Solving DDK issues under MSYS2

Posted: Thu 14 Dec, 2017 10:33 am
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.

Re: Solving DDK issues under MSYS2

Posted: Thu 14 Dec, 2017 6:29 pm
by SarahWalker
Fixed at rev 979.