cdrom-ioctl.c: #ifndef __MINGW64__ still necessary?

Discussion of development and patch submission.
Post Reply
UPerschke
Posts: 72
Joined: Wed 25 May, 2016 7:43 pm

cdrom-ioctl.c: #ifndef __MINGW64__ still necessary?

Post by UPerschke »

Throws a compiler error with rather up-to-date MSYS2/MinGW64 and 32 bit shell.
Compile works fine and binary as well if I comment out the whole #ifndef block for _CDROM_TOC_SESSION_DATA.
64 bit shell compiles without error.

MSYS2 used was from Battler found somewhere here in the forum and then updated via pacman -Syu last month.

I'm ok with having to comment the block, just thought I should mention it.

Error messages:

Code: Select all

cdrom-ioctl.c:18:16: error: redefinition of 'struct _CDROM_TOC_SESSION_DATA'
 typedef struct _CDROM_TOC_SESSION_DATA {
                ^
In file included from cdrom-ioctl.c:8:0:
E:/msys64_gcc52/mingw32/i686-w64-mingw32/include/ddk/ntddcdrm.h:168:16: note: originally defined here
 typedef struct _CDROM_TOC_SESSION_DATA {
                ^
cdrom-ioctl.c:23:3: error: conflicting types for 'CDROM_TOC_SESSION_DATA'
 } CDROM_TOC_SESSION_DATA, *PCDROM_TOC_SESSION_DATA;
   ^
In file included from cdrom-ioctl.c:8:0:
E:/msys64_gcc52/mingw32/i686-w64-mingw32/include/ddk/ntddcdrm.h:173:3: note: previous declaration of 'CDROM_TOC_SESSION_DATA' was here
 } CDROM_TOC_SESSION_DATA, *PCDROM_TOC_SESSION_DATA;
   ^
cdrom-ioctl.c:23:28: error: conflicting types for 'PCDROM_TOC_SESSION_DATA'
 } CDROM_TOC_SESSION_DATA, *PCDROM_TOC_SESSION_DATA;
Battler
Posts: 793
Joined: Sun 06 Jul, 2014 7:05 pm

Re: cdrom-ioctl.c: #ifndef __MINGW64__ still necessary?

Post by Battler »

The block is there because SarahWalker is still using outdated GCC (4.7.x?) to compile PCem and that version required this block. But the block makes 32-bit PCem uncompilable on the latest GCC. So does the stuff in soundopenal.c, as the latest MingW/GCC no longer includes alut, so the the code used to simulate alut for 64-bit PCem should be used for 32-bit too.
UPerschke
Posts: 72
Joined: Wed 25 May, 2016 7:43 pm

Re: cdrom-ioctl.c: #ifndef __MINGW64__ still necessary?

Post by UPerschke »

Noticed alut missing as well. Thanks for clarification. Might not be a bad idea to enhance related code sections using

__GNUC__
__GNUC_MINOR__
__GNUC_PATCHLEVEL__

Makes compiler choice more flexible without having to manually modify those sections on every single update.
Post Reply